Get url in asp.net

Get url in asp.net

string url = HttpContext.Current.Request.Url.AbsoluteUri;
// http://localhost:1302/TESTERS/Default6.aspx

string path = HttpContext.Current.Request.Url.AbsolutePath;
// /TESTERS/Default6.aspx

string host = HttpContext.Current.Request.Url.Host;
// localhost

string url = Request.Url.Host;


Here's the complete breakdown


Get url in asp.net Get url in asp.net Reviewed by Bhaumik Patel on 1:17 AM Rating: 5