Solved

ErrorPage ASP.NET VB

Posted on 2004-04-25
4
232 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

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

This document covers how to connect to SQL Server and browse its contents.  It is meant for those new to Visual Studio and/or working with Microsoft SQL Server.  It is not a guide to building SQL Server database connections in your code.  This is mo…
Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
There are cases when e.g. an IT administrator wants to have full access and view into selected mailboxes on Exchange server, directly from his own email account in Outlook or Outlook Web Access. This proves useful when for example administrator want…
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…

728 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