65.9K
CodeProject is changing. Read more.
Home

ASP.NET Page Transfer best practices

starIconstarIconstarIconstarIcon
emptyStarIcon
starIcon

4.86/5 (7 votes)

Apr 21, 2010

CPOL
viewsIcon

14091

Page Transfer best practices in ASP.NET.Scenario :Inside Try/Catch block, If you want to transfer/Redirect the page to another page - To avoid ThreadAbortException Option 1Use Response.Redirect("Pagetotransfer.aspx",false);OrOption...

Page Transfer best practices in ASP.NET. Scenario : Inside Try/Catch block, If you want to transfer/Redirect the page to another page - To avoid ThreadAbortException Option 1 Use
Response.Redirect("Pagetotransfer.aspx",false);
Or Option 2
Server.Execute("Pagetotransfer.aspx");
Or Option 3

try
{
  Response.Redirect("Pagetotransfer.aspx");
}
catch(ThreadAbortException  ex)
{

}
The preffered way of doing is option 1 or 2. Since it eliminates Exceptions I hope this helps!. Regards, -Vinayak