How to change the frame source(src) dynamically.?..!urgent
-
Dear Experts, I have a problem with frame. I have page webform1.aspx. I divided the screen into frames. The problem is that, I would like to change the source of the frame dynamically. How can I do this. I am sending querystring to the page webform1.aspx. In that querystring I am sending a page url, that should be added as source to the frame. Could you please help me. Thanks and Regards Gowtham Sen
-
Dear Experts, I have a problem with frame. I have page webform1.aspx. I divided the screen into frames. The problem is that, I would like to change the source of the frame dynamically. How can I do this. I am sending querystring to the page webform1.aspx. In that querystring I am sending a page url, that should be added as source to the frame. Could you please help me. Thanks and Regards Gowtham Sen
Hey, In fact myself I am working with IFrames. But the code logic is the same. Here's a snippet of my code :
HtmlControl frame1 = (HtmlControl)this.FindControl("frame1"); frame1.Attributes["src"] = "some_link.html";
Go to your html code and check the exact name of the property you want to dynamically change (in my case : src.) You must also addrunat=server
to you frame and give it an ID. Let me know if this helps. -
Hey, In fact myself I am working with IFrames. But the code logic is the same. Here's a snippet of my code :
HtmlControl frame1 = (HtmlControl)this.FindControl("frame1"); frame1.Attributes["src"] = "some_link.html";
Go to your html code and check the exact name of the property you want to dynamically change (in my case : src.) You must also addrunat=server
to you frame and give it an ID. Let me know if this helps.Hey, Thanks a lot. My page code is as follows. <%@ Page language="c#" Codebehind="dynamichelp.aspx.cs" AutoEventWireup="false" Inherits="RequestLaptop.dynamichelp" %> dynamic help
Here in the above I underline the frame, where I want to change source dynamically. In the above the frame help_display, where I would like to change the source dynamically. How can I do this. As you said, where do I add the code? Thanks and Regards Gowtham Sen.
-
Hey, Thanks a lot. My page code is as follows. <%@ Page language="c#" Codebehind="dynamichelp.aspx.cs" AutoEventWireup="false" Inherits="RequestLaptop.dynamichelp" %> dynamic help
Here in the above I underline the frame, where I want to change source dynamically. In the above the frame help_display, where I would like to change the source dynamically. How can I do this. As you said, where do I add the code? Thanks and Regards Gowtham Sen.
First add runat=server like this : runat= "server" src="Help_AboutApplicationLts.htm" bordercolor="#9999ff" style="BACKGROUND-COLOR: #ccccff; TEXT-DECORATION: overline"scrolling="auto"> The code to set the source is :
HtmlControl help_display = (HtmlControl)this.FindControl("help_display"); help_display.Attributes["src"] = your_new_source;
The code will be added todynamichelp.aspx.cs
Where exactly? That depends on your application logic (eg. when a button is clicked, when the page loads the first time, .....etc) It's up to you to decide. Good luck. -- modified at 8:25 Thursday 23rd March, 2006 -
Dear Experts, I have a problem with frame. I have page webform1.aspx. I divided the screen into frames. The problem is that, I would like to change the source of the frame dynamically. How can I do this. I am sending querystring to the page webform1.aspx. In that querystring I am sending a page url, that should be added as source to the frame. Could you please help me. Thanks and Regards Gowtham Sen
-
First add runat=server like this : runat= "server" src="Help_AboutApplicationLts.htm" bordercolor="#9999ff" style="BACKGROUND-COLOR: #ccccff; TEXT-DECORATION: overline"scrolling="auto"> The code to set the source is :
HtmlControl help_display = (HtmlControl)this.FindControl("help_display"); help_display.Attributes["src"] = your_new_source;
The code will be added todynamichelp.aspx.cs
Where exactly? That depends on your application logic (eg. when a button is clicked, when the page loads the first time, .....etc) It's up to you to decide. Good luck. -- modified at 8:25 Thursday 23rd March, 2006Thanks a lot my friend. But as you said I added runat="server". Then I am getting an error message as Page cannot be found. If I removed that, its working good. And another thing is, while I am debugging, the control is not going to dynamichelp.aspx.c file. How can I do this? Thanks and Regards Gowtham Sen.