Request.QueryString in customerrors

Posted on 2006-05-02
Last Modified: 2008-03-06
I want to use the customerrors page but I want the page to show the error.
I read that the customerror page has in its querystring the error but I don't succeed to get it.
I write <%=Request.QueryString["ErrorPage"] %> but I got nothing.
How do I get the error?
(the GetLastError() is not relevant here ofcourse).
Question by:ANAT2403
    1 Comment
    LVL 9

    Accepted Solution

    Hi ANAT2403,
    the errorpage variable you see in querystring is not the error (exception) itself.
    To get the error you should use GetLastError() and for example you could use GetLastError in global asax (where I presume you hadle the error event) and store it on session, then redirect to an error page that reads the error from session and presents it.
    However, this is not custom error pages. In order to set different pages for custom errors, you should configure them from IIS manager, but I don't think that is what you want.


    Featured Post

    Training Course: Java/J2EE and SOA

    This course will cover both core and advanced Java concepts like Database connectivity, Threads, Exception Handling, Collections, JSP, Servlets, XMLHandling, and more. You'll also learn various Java frameworks like Hibernate and Spring.

    Join & Write a Comment

    Suggested Solutions

    A quick way to get a menu to work on our website, is using the Menu control and assign it to a web.sitemap using SiteMapDataSource. Example of web.sitemap file: (CODE) Sample code to add to the page menu: (CODE) Running the application, we wi…
    It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
    Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
    Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

    731 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

    Need Help in Real-Time?

    Connect with top rated Experts

    17 Experts available now in Live!

    Get 1:1 Help Now