Loading response into Iframe

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Robert Bravery

    Loading response into Iframe

    HI All,

    I have an Ifame on my page. I have retrieved a page response from a server
    like:
    string response = Encoding.UTF8.G etString(respon seBytes);
    HtmlControl frame1 = (HtmlControl)th is.FindControl( "iframe1");

    I need to put the resultant page into the iframe as the src, But cant figure
    out how to do it. Obviously the response, as a string object wont work.
    How can I make the response, which has the html code of the rendered page,
    into the scr of the Iframe so that it would display correctly

    Thanbks
    Robert

  • Alberto Poblacion

    #2
    Re: Loading response into Iframe

    "Robert Bravery" <me@u.comwrot e in message
    news:F87577EF-8309-4450-932A-805553463D81@mi crosoft.com...
    I have an Ifame on my page. I have retrieved a page response from a server
    like:
    string response = Encoding.UTF8.G etString(respon seBytes);
    HtmlControl frame1 = (HtmlControl)th is.FindControl( "iframe1");
    >
    I need to put the resultant page into the iframe as the src, But cant
    figure out how to do it. Obviously the response, as a string object wont
    work.
    How can I make the response, which has the html code of the rendered page,
    into the scr of the Iframe so that it would display correctly
    You can set the src of the iframe to point to a .ashx inside your web
    site, and then code the .ashx to serve out as its response the content that
    you retrieve in your own code (which you would move into the .ashx). You can
    also do it with a .aspx but it is less efficient.


    Comment

    • Peter Bromberg [C# MVP]

      #3
      Re: Loading response into Iframe

      Here is a short article that shows how to manipulate an IFRAME server side,
      set the src property, etc:



      --Peter
      "Robert Bravery" <me@u.comwrot e in message
      news:F87577EF-8309-4450-932A-805553463D81@mi crosoft.com...
      HI All,
      >
      I have an Ifame on my page. I have retrieved a page response from a server
      like:
      string response = Encoding.UTF8.G etString(respon seBytes);
      HtmlControl frame1 = (HtmlControl)th is.FindControl( "iframe1");
      >
      I need to put the resultant page into the iframe as the src, But cant
      figure out how to do it. Obviously the response, as a string object wont
      work.
      How can I make the response, which has the html code of the rendered page,
      into the scr of the Iframe so that it would display correctly
      >
      Thanbks
      Robert
      >

      Comment

      Working...