Solved

ErrorPage ASP.NET VB

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

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

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

Welcome my friends to the second instalment and follow-up to our Minify and Concatenate Your Scripts and Stylesheets (http://www.experts-exchange.com/Programming/Languages/.NET/ASP.NET/A_4334-Minify-and-Concatenate-Your-Scripts-and-Stylesheets.html)…
In my previous article (http://www.experts-exchange.com/Programming/Languages/.NET/.NET_Framework_3.x/A_4362-Serialization-in-NET-1.html) we saw the basics of serialization and how types/objects can be serialized to Binary format. In this blog we wi…
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…

777 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