Reputation: 789
I am working on a web application in ASP.Net
and I am implementing a Network Graph Library
.
The Network Graph
is located on a page called Test.aspx
.
I am calling Test.aspx
through iframe
:
DetailsBody.Text = DetailsBody.Text + "<td><iframe scrolling=\"no\"
id=\"graphframe\" src=\"Test.aspx\" width=\"100%\"
height=\"275px\"></iframe></td>";
I need to pass a parameter from the page where the iframe
is located to the Test.aspx
page.
Thanks in advance
Upvotes: 0
Views: 9397
Reputation: 186
You can use any of the following approach:
Upvotes: 1
Reputation: 97
If you want to Pass the parameters through the Code behind,
HtmlControl frame1 = (HtmlControl)this.FindControl("I_Frame_Name");
frame1.Attributes["src"] = "Test.aspx";
frame1.Attributes["scrolling"] = "no";
frame1.Attributes["id"] = "graphframe";
frame1.Attributes["width"] = "100%";
frame1.Attributes["height"] = "275px";
Upvotes: 0
Reputation: 22323
You may pass the param like this.
<iframe src="Test.aspx?YourParam=<%=somevariable%>" scrolling=\"no\" width="100" height="275px" frameborder="0"></iframe>
and for multipal param:
<iframe src="Test.aspx?Param1=<%=somevariable%>&Param2=<%=vartwo%>&Param3=<%=varthree%>" scrolling=\"no\" width="100" height="275px" frameborder="0"></iframe>
Upvotes: 2