asp.net.ph

Server.Execute Method ( String, TextWriter )

System.Web Namespace   HttpServerUtility Class


Executes a request to another page using the specified URL path to the page. A TextWriter captures output from the page.

[ VB ]
Overloads Public Sub Execute ( _
   ByVal path As String, _
   ByVal writer As TextWriter _
)

[ C# ]
public void Execute (
   string path,
   TextWriter writer
);

[ C++ ]
public: void Execute (
   String* path,
   TextWriter* writer
);

[ JScript ]
public function Execute (
   path : String,
   writer : TextWriter
);

Parameters

path
The URL path of the new request.
writer
The TextWriter to capture the output.

Exceptions


Exception Type Condition
HttpException Occurs when the child process could not be executed.

Remarks

The Execute method continues execution of the original page after execution of the new page is completed. The Transfer method unconditionally transfers execution to another page.

Example

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.

[ 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 ( ) );
   
See Also

HttpServerUtility Members   HttpServerUtility.Execute Overload List Skip Navigation Links




Home
Suggested Reading


Previous page Back to top Next page

© 2000-2010 Rey Nuñez All rights reserved.

If you have any question, comment or suggestion
about this site, please send us a note

You can help support asp.net.ph