Sunday, 20 December 2015

How to get the current URL from ASP.NET code behind

string url = HttpContext.Current.Request.Url.AbsoluteUri;
string path = HttpContext.Current.Request.Url.AbsolutePath;
/dir/Default.aspx
string host = HttpContext.Current.Request.Url.Host;
thehost.com

No comments:

Post a Comment