-2

I am using URL Redirection in ASP.net like this page

http://xyz:6477/BoxOffice/Events/353454

Redirect to >>>

http://xyz:6477/BoxOffice/Events.aspx?EventId=353454

I want to get URL on page load of event page

http://xyz:6477/BoxOffice/Events/353454
SOF User
  • 7,590
  • 22
  • 75
  • 121
  • HttpRequest.UrlReferrer Property http://msdn.microsoft.com/en-us/library/system.web.httprequest.urlreferrer.aspx – JamieSee May 18 '12 at 22:58

1 Answers1

-2

Use

//To get referrer
//in C#
Uri MyUrl = Request.UrlReferrer; 

//in vb
Dim MyUrl As Uri = Request.UrlReferrer 

//To get current
//in C#

Uri currrenturl = Request.Url;
//in vb
Dim currentUrl As Uri = Request.Url

If you are using routing then use

    //c#
    string ref = Request.UrlReferrer.LocalPath;
Krishanu Dey
  • 6,326
  • 7
  • 51
  • 69