return URL

HLRosenberger
HLRosenberger used Ask the Experts™
on
Is there a way to know what URL the user was on prior to my page?  I want to programmatically return to that URL when the user closes my page.
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
HainKurtSr. System Analyst

Commented:
use Request.ServerVariables("HTTP_REFERER")
Commented:
VB:

If Not Request.UrlReferrer Is Nothing Then
   Response.Redirect (Request.UrlReferrer.ToString)
End If


C#:

if ((Request.UrlReferrer != null)) {
      Response.Redirect(Request.UrlReferrer.ToString);
}

Author

Commented:
Thanks

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial