Solved

ErrorPage ASP.NET VB

Posted on 2004-04-25
4
233 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: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone 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

Flash (http://en.wikipedia.org/wiki/Adobe_Flash) has evolved over the years to where it has become a masterful tool for displaying content screen.  It has excellent layout placement, UI precision as well as rendering capabilities. This, along with t…
It seems a simple enough task, yet I see repeated questions asking how to do it: how to pass data between two forms. In this article, I will show you the different mechanisms available for you to do just that. This article is directed towards the .N…
There's a multitude of different network monitoring solutions out there, and you're probably wondering what makes NetCrunch so special. It's completely agentless, but does let you create an agent, if you desire. It offers powerful scalability …
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …

623 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