Monday, July 30, 2012

ThreadAbortException Occurs If You Use Response.Write

Thread exception occurs if you use
Response.Redirect ("Demo.aspx");
Cause:The Response.Redirect method ends the page execution and shifts the execution to the Application_EndRequest event in the application's event pipeline. The line of code that follows Response.End is not executed.

This problem occurs with: Response.End and  Server.Transfer also.

To fix this issue use
Response.Redirect ("Demo.aspx", false);

Also read this article:
http://support.microsoft.com/default.aspx?scid=KB;EN-US;312629

No comments:

Post a Comment

Open default email app in .NET MAUI

Sample Code:  if (Email.Default.IsComposeSupported) {     string subject = "Hello!";     string body = "Excellent!";    ...