Solved

ErrorPage ASP.NET VB

Posted on 2004-04-25
4
228 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

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Many of us here at EE write code. Many of us write exceptional code; just as many of us write exception-prone code. As we all should know, exceptions are a mechanism for handling errors which are typically out of our control. From database errors, t…
For those of you who don't follow the news, or just happen to live under rocks, Microsoft Research released a beta SDK (http://www.microsoft.com/en-us/download/details.aspx?id=27876) for the Xbox 360 Kinect. If you don't know what a Kinect is (http:…
This video discusses moving either the default database or any database to a new volume.
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

706 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now