How to get a url of Page from where you Redirected to current page in with C#


Here i want to get the full path of the page from where it is redirected in other words i want to get URL of the source page from where it is redirected

Code in C# :-

string s=Request.ServerVariables["HTTP_REFERER"]; 

Above code will return Full Path of the Source Page, but if you want only the Page Name from where you Redirected then here is the code for you :- 

_REFERER"].LastIndexOf("/") + 1); 

Post a Comment