从codebehind传递参数到iframe [英] passing parameters to an iframe from codebehind
问题描述
我的aspx代码
Hi ,
this my aspx code
<iframe id="I1" runat="server" frameborder="0" vspace="0" hspace="0" marginwidth="0" marginheight="0" scrolling="auto" src="../MasterPage/Listpage.aspx?id=3" name="I1" style="width: 672px; height: 210px">
</iframe> </li>
我的代码落后:
I1.Attributes.Add(src,../MasterPage /Listpage.aspx?CompanyID =+ strCompanyid);
这里我需要将参数strcompanyid,param1,param2传递给另一个页面(LISTPAGE)请帮我解决如何从代码后面传递多个值,我在Internet上搜索无法找到这个
代码后面(listpage.aspx)
intCompanyID = Convert.ToInt32( Request.QueryString [CompanyID]);
my code behind:
I1.Attributes.Add("src", "../MasterPage/Listpage.aspx?CompanyID=" + strCompanyid);
Here i need to pass the parameter strcompanyid,param1,param2 to another page(LISTPAGE) pls help me out how to pass the multiple values from code behind, i searched in Internet not able to find this
code Behind(listpage.aspx)
intCompanyID = Convert.ToInt32(Request.QueryString["CompanyID"]);
推荐答案
只需在查询字符串中添加更多参数。您已经拥有I1.Attributes.Add(src,。 ./MasterPage/Listpage.a spx?CompanyID =+ strCompanyid所以现在只做
Just add more parameters to your querystring. You already have I1.Attributes.Add("src", "../MasterPage/Listpage.aspx?CompanyID=" + strCompanyid) so now just do
I1.Attributes.Add("src", "../MasterPage/Listpage.aspx?CompanyID=" + strCompanyid + "&parm1=" + Parm1)
然后您可以使用¶mname= paramvalue格式继续添加更多参数。
You can then keep adding on more parameters as needed using the ¶mname=paramvalue format.
这篇关于从codebehind传递参数到iframe的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!