Can we show error message in Custom error defaultRedirect page

Discussion in 'ASP .Net' started by ad, Jul 5, 2005.

  1. ad

    ad Guest

    I have a customErrors section in Web.config.

    All error except error 403 and 404, will be redirect to
    GenericErrorPage.aspx.

    How can I show the e.Message or some explicit statement according the error
    type in GenericErrorPage.aspx?

    ----------------------------------------------------------------------------
    ----------------------------------------------------
    <customErrors mode="RemoteOnly" defaultRedirect="GenericErrorPage.aspx">
    <error statusCode="403" redirect="NoAccess.aspx"/>
    <error statusCode="404" redirect="FileNotFound.aspx"/>
    </customErrors>
     
    ad, Jul 5, 2005
    #1
    1. Advertising

  2. ad

    Curt_C [MVP] Guest

    ad wrote:
    > I have a customErrors section in Web.config.
    >
    > All error except error 403 and 404, will be redirect to
    > GenericErrorPage.aspx.
    >
    > How can I show the e.Message or some explicit statement according the error
    > type in GenericErrorPage.aspx?
    >
    > ----------------------------------------------------------------------------
    > ----------------------------------------------------
    > <customErrors mode="RemoteOnly" defaultRedirect="GenericErrorPage.aspx">
    > <error statusCode="403" redirect="NoAccess.aspx"/>
    > <error statusCode="404" redirect="FileNotFound.aspx"/>
    > </customErrors>
    >
    >


    Do you have Server access?
    Change it in the IIS manager instead of the config perhaps?

    --
    Curt Christianson
    site: http://www.darkfalz.com
    blog: http://blog.darkfalz.com
     
    Curt_C [MVP], Jul 5, 2005
    #2
    1. Advertising

  3. dim e as exception = server.GetLastError()

    though I dont think this will catch errors such as 404 which would usually
    be caught by IIS. Good for catching exceptions in your app though... HTH jd

    "ad" wrote:

    > I have a customErrors section in Web.config.
    >
    > All error except error 403 and 404, will be redirect to
    > GenericErrorPage.aspx.
    >
    > How can I show the e.Message or some explicit statement according the error
    > type in GenericErrorPage.aspx?
    >
    > ----------------------------------------------------------------------------
    > ----------------------------------------------------
    > <customErrors mode="RemoteOnly" defaultRedirect="GenericErrorPage.aspx">
    > <error statusCode="403" redirect="NoAccess.aspx"/>
    > <error statusCode="404" redirect="FileNotFound.aspx"/>
    > </customErrors>
    >
    >
    >
     
    =?Utf-8?B?bG9uZG9uIGNhbGxpbmc=?=, Jul 5, 2005
    #3
    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. Darrin J Olson

    defaultRedirect

    Darrin J Olson, Dec 19, 2003, in forum: ASP .Net
    Replies:
    1
    Views:
    2,049
    nfedin
    Dec 19, 2003
  2. Gary

    defaultRedirect wont work

    Gary, Jan 25, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    402
    Steven Cheng[MSFT]
    Jan 26, 2004
  3. Gary
    Replies:
    6
    Views:
    2,458
    Steven Cheng[MSFT]
    Feb 3, 2004
  4. Gary

    DefaultRedirect Problem

    Gary, Feb 2, 2004, in forum: ASP .Net
    Replies:
    9
    Views:
    2,035
    Steven Cheng[MSFT]
    Apr 10, 2004
  5. =?Utf-8?B?RGF2ZQ==?=

    GetLastError in defaultRedirect page?

    =?Utf-8?B?RGF2ZQ==?=, Apr 21, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    2,119
    Saravana [MVP]
    Apr 22, 2004
Loading...

Share This Page