Loading response into Iframe

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
 
A

Alberto Poblacion

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top