Capture Error Page Url

Posted on 2012-09-04
Last Modified: 2012-09-04
I've added the code below to my web.config.

How do I capture the url they tried to use?

Example...if they tried to manually type in Home.aspx, and they actually typed in Hone.aspx and end up at my oops page.

<customErrors mode="On" defaultRedirect="~/ErrorPages/oops.aspx?type=error">
            <error statusCode="404" redirect="~/ErrorPages/oops.aspx?type=404"/>
            <error statusCode="405" redirect="~/ErrorPages/oops.aspx?type=405"/>
            <error statusCode="406" redirect="~/ErrorPages/oops.aspx?type=406"/>

Open in new window

Question by:lrbrister
    LVL 83

    Accepted Solution

    You can either use the Request.URLReferrer or Server.GetLastError()

    Author Closing Comment


    Featured Post

    Live: Real-Time Solutions, Start Here

    Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

    Join & Write a Comment

    Parsing a CSV file is a task that we are confronted with regularly, and although there are a vast number of means to do this, as a newbie, the field can be confusing and the tools can seem complex. A simple solution to parsing a customized CSV fi…
    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…
    This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA.…
    This video discusses moving either the default database or any database to a new volume.

    745 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

    14 Experts available now in Live!

    Get 1:1 Help Now