Catch previous url

Discussion in 'ASP .Net' started by Jason Zhou, Jun 26, 2004.

  1. Jason Zhou

    Jason Zhou Guest


    I have a question on how to get the previous url in custom error file. Here
    is what I am doing:

    If someone visit my website with a wrong file name or wrong directory name,
    IIS will automatically show error 404 page, this was setup by default in IIS
    web site properties/Custom Errors. I replaced that 404b.htm with my aspx
    file try to handle this error by myself. the problem is that I can not get
    previous url that user requested in my aspx page, I was thinking that
    urlreferer property, but it does not work either. Does anybody has
    experience on this issue before?

    If I don't use that custom error page, do I have anyway to get control even
    the file or directory specified in the request does not exist on my website?

    Any suggestion will be appreciated.

    Jason Zhou, Jun 26, 2004
    1. Advertisements

  2. Jason Zhou

    Guest Guest

    I think you may try using javascript like this:
    <input type="button" name="return" value="Prev" onClick="window.history.go(-1);">
    Guest, Jun 26, 2004
    1. Advertisements

  3. Jason Zhou

    Jason Zhou Guest

    Good point, but the problem is that I want to get the url instead of go
    that url, according to internet sdk, this previous url is not exposed
    for surity reason, so I still can not make it.

    But thanks anyway!


    *** Sent via Devdex ***
    Don't just participate in USENET...get rewarded for it!
    Jason Zhou, Jun 28, 2004
    1. Advertisements

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.