从代码背后转发的页面 [英] Page Forward from Code Behind
问题描述
我的情况是,我需要让用户通过电子邮件点击链接,并将链接带到我网站上的特定网页。通常这是第1天的HTML编码,但我正在使用iFrame。我知道比使用iFrame更好,但在这种情况下,我别无选择。
为了解决这个问题,我在我的QuesryString中添加一个参数,然后检索它在我的Default.aspx页面上的PageLoad中。 Default.aspx页面包含2个iFrame,1表示我的标题,1表示我的正文内容。
我想读取我的QueryString参数,如果设置了(myUrl / default.aspx?forward = yes)那么我想要我的身体内容iFrame去特定页面。
I have a situation where I need to have users click a link via email have the link take them to a specific web page on my site. Normally this is day 1 HTML coding, but I''m using iFrames. I know better than to use iFrames, but in this case, I have no choice.
To get around this problem, I add a parameter to my QuesryString, then retrieve it during my PageLoad on my Default.aspx page. The Default.aspx page contains 2 iFrames, 1 for my header and 1 for my body content.
I want to read my QueryString parameter, and if it is set (myUrl/default.aspx?forward=yes) then I want my body content iFrame to go to a specific page.
protected void Page_Load(object sender, EventArgs e)
{
//Forward url if param found in querystring
string urlForward = "";
urlForward = Request.QueryString["forward"];
string newPage = "MyNewPage.aspx";
if (urlForward == "yes")
{
//Code to forward to a specific page in the body content iFrame
}
}
推荐答案
试试这个
iframe2.Attributes [src] =https://www.google.com;
try this
iframe2.Attributes["src"] = "https://www.google.com";
这篇关于从代码背后转发的页面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!