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.
From stackoverflow
burnt1ce
-
Override the calling page's Render method to call the target page's Render method and insert the contents in the rendered output..
John Saunders : How about page life cycle of the other page?From Colin -
Convert the other page to a usercontrol, and consume it.
From James -
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);James : +1 I didn't realize that was possible, good to know!John Saunders : 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.From John Saunders
0 comments:
Post a Comment