System.Web Namespace HttpServerUtility Class
Executes a request to another page.
1. Executes a request to another page using the specified URL path to the page.
2. Executes a request to another page using the specified URL path to the page. A TextWriter captures output from the page.
The following example executes the aspx page "Login.aspx" on the server in the current directory and receives the output from the page through the StringWriter object writer. It writes the HTML stream received from writer to the HTTP output stream.
NOTE: This example shows how to use one of the overloaded versions of Execute. For other examples that might be available, see the individual overload topics.
[ VB ]
Dim writer As New StringWriter
Server.Execute ( "Login.aspx", writer )
Response.Write ( "<H3>Please Login:</H3><br>" & writer.ToString ( ) )
[ C# ]
StringWriter writer = new StringWriter ( );
Server.Execute ( "Login.aspx", writer );
Response.Write ( "<H3>Please Login:</H3><br>"+ writer.ToString ( ) );
HttpServerUtility Members