Loading response into Iframe

  • Thread starter Thread starter Robert Bravery
  • Start date Start date
R

Robert Bravery

HI All,

I have an Ifame on my page. I have retrieved a page response from a server
like:
string response = Encoding.UTF8.GetString(responseBytes);
HtmlControl frame1 = (HtmlControl)this.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
 
Robert Bravery said:
I have an Ifame on my page. I have retrieved a page response from a server
like:
string response = Encoding.UTF8.GetString(responseBytes);
HtmlControl frame1 = (HtmlControl)this.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.
 
Back
Top