在内容所有者中重定向网站 [英] Redirect website in content holder

查看:99
本文介绍了在内容所有者中重定向网站的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨.
我正在使用母版页文件来实现我的项目,在该项目中单击链接,该页面将显示在内容所有者中.
现在,我想创建一个新链接,该链接将重定向到在线网站.
可以说,我将其链接到codeproject.com,我希望将代码项目页面显示在内容持有者内部.

Hi.
I m using master page file to implement my project where click at the links, the page will be displayed in the content holder.
Now i want to create new link where it will redirect to online web site.
Lets say,i linked it to codeproject.com,i want the code project page to be displayed inside the content holder.

Any ideas guys?

推荐答案

内容所有者必须是iframe,然后您就可以这样做.
The content holder needs to be an iframe, then you can do this.


好吧,我在这里获得了iframe代码:
< iframe src ="http://google.com"></iframe>

以及以下返回代码:
Ok,i got the iframe code here:
<iframe src="http://google.com"></iframe>

And the following back code:
protected void Button1_Click(object sender, EventArgs e)
        {
            Response.Redirect("http://www.google.com/search?hl=en&q=" + TextBox1.Text.ToString() + "");  
        }


反向代码在浏览器中作为新页面运行,其中将在TextBox1中输入的关键字重定向到新的Google页面,以搜索在TextBox1中输入的关键字.

现在,我要向后代码功能在iframe上运行,而相同的功能在iframe上运行.

有什么想法吗?


The back code runs as a new page in browser,where keyword entered in TextBox1 redirect to new google page to search for the keyword entered in TextBox1.

Now i want the back code function runs on the iframe,where the same function runs on the iframe.

Any ideas?


你好,

试试这样的

< iframe runat =服务器" id ="iframe1" src ="></iframe>

.cs

hello,

Try something like this

<iframe runat="server" id="iframe1" src=""></iframe>

.cs

protected void Button1_Click(object sender, EventArgs e)
    {
        iframe1.Attributes.Add("src", "http://www.google.com/search?hl=en&q=" + TextBox1.Text + "");
    }


这篇关于在内容所有者中重定向网站的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆