views:

126

answers:

3

I have a ASP.NET page. I have another asp.net page, that i would like to render and import it's rendered results into my asp.net page. I don't want to use or use AJAX request as that would cause my visitors to make an unnecessary HTTP request and decrease performance.

A: 

Override the calling page's Render method to call the target page's Render method and insert the contents in the rendered output..

Colin
How about page life cycle of the other page?
John Saunders
+1  A: 

Convert the other page to a usercontrol, and consume it.

James
+1  A: 

I haven't tried this myself, but take a look at the Execute(String, TextWriter, Boolean) method of the HttpServerUtility class:

Server.Execute("OtherPage.aspx", Response.Output, true);
John Saunders
+1 I didn't realize that was possible, good to know!
James
Now that I've got you motivated, go read through the MSDN documentation on the HttpServerUtility, HttpRequest, HttpResponse and HttpContext objects. You won't catch all the features all at once, but we depend on them so much, that it's good to scan the documentation from time to time, at least a couple of times a year. I've never used this call, but I knew it was there, and this is how I knew.
John Saunders