Assuming the current page full address is:Http://www.test.com/aaa/bbb.aspx?id=5&name=kelli
"/HTTP" is the protocol name
"Www.test.com" is the domain name
"AAA" is the station name.
"Bbb.aspx" is the page name (file name)
"Id=5&name=kelli" is a parameter
"1" gets the full URL (protocol name + domain + site name + file name + parameter)
String url=request.url.tostring ();
Url= Http://www.test.com/aaa/bbb.aspx?id=5&name=kelli
"2" gets the site name + page name + parameters:
String Url=request.rawurl;
(or string url=request.url.pathandquery;)
Url= /aaa/bbb.aspx?id=5&Name=kelli
"3" Get Site name + page name:
String Url=httpcontext.current.request.url.absolutepath;
(or string url= HttpContext.Current.Request.Path;)
Url= aaa/bbb.aspx
"4" Gets the domain name:
String Url=httpcontext.current.request.url.host;
Url= www.test.com
"5" gets the parameter:
String Url= HttpContext.Current.Request.Url.Query;
url= ? Id=5&name=kelli
GOTO: ASP. NET get URL parameters