avoiding "server error in '/'application" error page (VBNET, Website)

Discussion in 'ASP .Net' started by ton, Sep 18, 2006.

  1. ton

    ton Guest

    Hi,
    I've developed some webcontrols in VB, I'm using these in a website project
    If the webcontrol is getting an error I ll get the message:
    Server error in '/' application, and than more information.
    This can occur, but I donot want to see this error page. In stead I want the
    program to show a standard form where I can tell that bla vla bla and try
    again later. In the ASP.NET configuration I can specify a URL in case of an
    error. But I'll do not see this to be used.

    Who can tell ?

    thanx

    ton
     
    ton, Sep 18, 2006
    #1
    1. Advertising

  2. In your web.config, set customErrors to ON:


    <!-- CUSTOM ERROR MESSAGES
    Set customErrors mode="On" or "RemoteOnly" to enable custom
    error messages, "Off" to disable.
    Add <error> tags for each of the errors you want to handle.

    "On" Always display custom (friendly) messages.
    "Off" Always display detailed ASP.NET error information.
    "RemoteOnly" Display custom (friendly) messages only to users
    not running
    on the local Web server. This setting is recommended for
    security purposes, so
    that you do not display application detail information to
    remote clients.
    -->
    <customErrors mode="on" />

    ton wrote:
    > Hi,
    > I've developed some webcontrols in VB, I'm using these in a website project
    > If the webcontrol is getting an error I ll get the message:
    > Server error in '/' application, and than more information.
    > This can occur, but I donot want to see this error page. In stead I want the
    > program to show a standard form where I can tell that bla vla bla and try
    > again later. In the ASP.NET configuration I can specify a URL in case of an
    > error. But I'll do not see this to be used.
    >
    > Who can tell ?
    >
    > thanx
    >
    > ton
     
    Sean Chambers, Sep 18, 2006
    #2
    1. Advertising

  3. ton

    ton Guest

    thanx, it is simple and it works


    "Sean Chambers" <> schreef in bericht
    news:...
    > In your web.config, set customErrors to ON:
    >
    >
    > <!-- CUSTOM ERROR MESSAGES
    > Set customErrors mode="On" or "RemoteOnly" to enable custom
    > error messages, "Off" to disable.
    > Add <error> tags for each of the errors you want to handle.
    >
    > "On" Always display custom (friendly) messages.
    > "Off" Always display detailed ASP.NET error information.
    > "RemoteOnly" Display custom (friendly) messages only to users
    > not running
    > on the local Web server. This setting is recommended for
    > security purposes, so
    > that you do not display application detail information to
    > remote clients.
    > -->
    > <customErrors mode="on" />
    >
    > ton wrote:
    >> Hi,
    >> I've developed some webcontrols in VB, I'm using these in a website
    >> project
    >> If the webcontrol is getting an error I ll get the message:
    >> Server error in '/' application, and than more information.
    >> This can occur, but I donot want to see this error page. In stead I want
    >> the
    >> program to show a standard form where I can tell that bla vla bla and try
    >> again later. In the ASP.NET configuration I can specify a URL in case of
    >> an
    >> error. But I'll do not see this to be used.
    >>
    >> Who can tell ?
    >>
    >> thanx
    >>
    >> ton

    >
     
    ton, Sep 18, 2006
    #3
  4. You can even tell it to display an html page that you made like so:

    <customErrors defaultRedirect="404.html" mode="On">
    <error statusCode="404" redirect="404.html" />
    </customErrors>

    ton wrote:
    > thanx, it is simple and it works
    >
    >
    > "Sean Chambers" <> schreef in bericht
    > news:...
    > > In your web.config, set customErrors to ON:
    > >
    > >
    > > <!-- CUSTOM ERROR MESSAGES
    > > Set customErrors mode="On" or "RemoteOnly" to enable custom
    > > error messages, "Off" to disable.
    > > Add <error> tags for each of the errors you want to handle.
    > >
    > > "On" Always display custom (friendly) messages.
    > > "Off" Always display detailed ASP.NET error information.
    > > "RemoteOnly" Display custom (friendly) messages only to users
    > > not running
    > > on the local Web server. This setting is recommended for
    > > security purposes, so
    > > that you do not display application detail information to
    > > remote clients.
    > > -->
    > > <customErrors mode="on" />
    > >
    > > ton wrote:
    > >> Hi,
    > >> I've developed some webcontrols in VB, I'm using these in a website
    > >> project
    > >> If the webcontrol is getting an error I ll get the message:
    > >> Server error in '/' application, and than more information.
    > >> This can occur, but I donot want to see this error page. In stead I want
    > >> the
    > >> program to show a standard form where I can tell that bla vla bla and try
    > >> again later. In the ASP.NET configuration I can specify a URL in case of
    > >> an
    > >> error. But I'll do not see this to be used.
    > >>
    > >> Who can tell ?
    > >>
    > >> thanx
    > >>
    > >> ton

    > >
     
    Sean Chambers, Sep 18, 2006
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    1
    Views:
    463
    Gerry O'Brien [MVP]
    Feb 2, 2004
  2. Showjumper
    Replies:
    5
    Views:
    453
    Showjumper
    Jul 17, 2003
  3. Dave Willock
    Replies:
    1
    Views:
    4,039
    John Timney \(Microsoft MVP\)
    Jan 10, 2004
  4. Jeff Dillon

    Temp File Location for VBNET Compiler

    Jeff Dillon, May 10, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    748
    Jeff Dillon
    May 10, 2004
  5. Replies:
    3
    Views:
    130
    Brynn
    Jan 4, 2004
Loading...

Share This Page