Thursday, March 7, 2013
Labels:
Asp.net
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
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 :-
How to get a url of Page from where you Redirected to current page in asp.net with C#
Posted by
Abhay Makadiya
at
3/07/2013
Description:-
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 :-
Request.ServerVariables["HTTP_REFERER"].Substring(Request.ServerVariables["HTTP
_REFERER"].LastIndexOf("/") + 1);
Subscribe to:
Post Comments
(
Atom
)
No comments :
Post a Comment