Application_Error - Server.Transfer fails

S

Steven Cheng[MSFT]

Hello Dave,

I have posted some explanation about this behavior in your another post
below:

Subject: Application_Start & Exceptions
Newsgroups: microsoft.public.dotnet.framework.aspnet

and according to the ASP.NET model, you can use the following code based on
my test:

=============
void Application_Error(object sender, EventArgs e)
{

if(Context.ApplicationInstance != null)
Context.Server.Transfer("~/errorinfo.aspx");
else
Context.Response.Redirect("~/errorinfo.aspx");
}
=============

Hope this helps.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead


This posting is provided "AS IS" with no warranties, and confers no rights.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top