Capture Error Page Url

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"/>
        </customErrors>

Open in new window

Larry Bristersr. DeveloperAsked:
Who is Participating?
 
CodeCruiserConnect With a Mentor Commented:
You can either use the Request.URLReferrer or Server.GetLastError()
0
 
Larry Bristersr. DeveloperAuthor Commented:
Thanks
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.