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.
我有一个ASP.NET页面。我有另一个asp.net页面,我想渲染并将其渲染结果导入我的asp.net页面。我不想使用或使用AJAX请求,因为这会导致我的访问者发出不必要的HTTP请求并降低性能。
3 个解决方案
#1
Convert the other page to a usercontrol, and consume it.
将其他页面转换为usercontrol,然后使用它。
#2
I haven't tried this myself, but take a look at the Execute(String, TextWriter, Boolean) method of the HttpServerUtility class:
我自己没有尝试过这个,但是看一下HttpServerUtility类的Execute(String,TextWriter,Boolean)方法:
Server.Execute("OtherPage.aspx", Response.Output, true);
#3
Override the calling page's Render method to call the target page's Render method and insert the contents in the rendered output..
覆盖调用页面的Render方法以调用目标页面的Render方法并将内容插入到渲染输出中。
#1
Convert the other page to a usercontrol, and consume it.
将其他页面转换为usercontrol,然后使用它。
#2
I haven't tried this myself, but take a look at the Execute(String, TextWriter, Boolean) method of the HttpServerUtility class:
我自己没有尝试过这个,但是看一下HttpServerUtility类的Execute(String,TextWriter,Boolean)方法:
Server.Execute("OtherPage.aspx", Response.Output, true);
#3
Override the calling page's Render method to call the target page's Render method and insert the contents in the rendered output..
覆盖调用页面的Render方法以调用目标页面的Render方法并将内容插入到渲染输出中。