Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. How to change the frame source(src) dynamically.?..!urgent

How to change the frame source(src) dynamically.?..!urgent

Scheduled Pinned Locked Moved ASP.NET
helpquestiontutorial
6 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • G Offline
    G Offline
    Gowtham Sen
    wrote on last edited by
    #1

    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

    B I 2 Replies Last reply
    0
    • G 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

      B Offline
      B Offline
      benqazou
      wrote on last edited by
      #2

      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 add runat=server to you frame and give it an ID. Let me know if this helps.

      G 1 Reply Last reply
      0
      • B benqazou

        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 add runat=server to you frame and give it an ID. Let me know if this helps.

        G Offline
        G Offline
        Gowtham Sen
        wrote on last edited by
        #3

        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.

        B 1 Reply Last reply
        0
        • G 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.

          B Offline
          B Offline
          benqazou
          wrote on last edited by
          #4

          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 to dynamichelp.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

          G 1 Reply Last reply
          0
          • G 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

            I Offline
            I Offline
            Ista
            wrote on last edited by
            #5

            use javascript to change it document.getElementByID('MyFrame').src = 'mynamepage.aspx'; 1 line of code equals many bugs. So don't write any!!

            1 Reply Last reply
            0
            • B benqazou

              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 to dynamichelp.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

              G Offline
              G Offline
              Gowtham Sen
              wrote on last edited by
              #6

              Thanks 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.

              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • World
              • Users
              • Groups