Solved

ErrorPage ASP.NET VB

Posted on 2004-04-25
4
230 Views
Last Modified: 2010-05-18
Can i get more detail on what the error is about or even more?
Rather than just telling user that an error has occur?
0
Comment
Question by:yan_er04
4 Comments
 
LVL 15

Accepted Solution

by:
Timbo87 earned 25 total points
ID: 10912473
Open Notepad and paste this in:

<configuration>
    <system.web>
        <customErrors mode="Off"/>
    </system.web>
</configuration>
 
Save this as web.config (not web.config.txt) and place this in the directory of your ASP.NET files. Also set debug to true in the page directive for each ASPX page:.

<%@ Page Language="C#" Debug="True" %>
Change the language to VB if you're using VB.NET.

When you're site goes public though, you'll want to take the debug's in the page directive out and NOT let them view the errors remotely, as it could comprimise your code and security.
0
 
LVL 37

Assisted Solution

by:gregoryyoung
gregoryyoung earned 25 total points
ID: 10912985
If you have your system coded anything resembling properly this will not compromise your security however it is rather nasty.

You can also use the default error handler (in global.asax) to write your own custom error handler. Any exceptions that do not get handled will get passed to here. A good example of something to do here would be to create a page for showing an error message. Then in this area put code something like this ...

error.asmx (displays error message passed in ERRORTEXT)

in global ...

Exception Ex = Server.GetLastError().InnerException ;
string ErrorText = Ex.Message() ;
Response.Redirect("/error.asmx" + "?ERRORTEXT=" + ErrorText) ;



you can also get the stack dump etc here if you wanted to send an email to yourself / write event log etc.

I gave an example here of how to write event log and email ... http://www.experts-exchange.com/Programming/Programming_Languages/C_Sharp/Q_20953054.html

Greg
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Summary Displaying images in RichTextBox is a common requirement with limited solutions available. Pasting through clipboard or embedding into RTF content only support static images.  This article describes how to insert Windows control objects int…
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…

839 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question