ASP.NET customized error page

B

Brian Henry

I want to have a custom page for errors, instead of the standard page which
we get now built into asp.net, so i can have the error page shown in the
company's template... how would i go about doing this? anything to do with
the application_error in the global.asax.vb file? thanks!
 
B

Brian Henry

i guess i should add to this, and display the trace information in the
custom page..
 
V

Vinay

Add this to the web.config file

<customErrors defaultRedirect="ErrorPage.aspx" mode="On">

</customErrors>

To get the trace information use:

Put this in the Application_Error section of the the global.asax.vb file

str = "Error: " & Server.GetLastError().InnerException.ToString() & vbCrLf &
vbCrLf & Request.Url.ToString & vbCrLf & "Message: " &
Server.GetLastError().Message.ToString & vbCrLf & " Source: " &
Server.GetLastError().Source.ToString

You may want/need to modify the above line - this is a cut 'n' paste from my
app.

Vinay
 
G

Guest

-----Original Message-----
I want to have a custom page for errors, instead of the standard page which
we get now built into asp.net, so i can have the error page shown in the
company's template... how would i go about doing this? anything to do with
the application_error in the global.asax.vb file? thanks!


.
 

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

Members online

No members online now.

Forum statistics

Threads
473,756
Messages
2,569,540
Members
45,025
Latest member
KetoRushACVFitness

Latest Threads

Top