Answers for "c-sharp - get current page url/path/host"

C#
0

c-sharp - get current page url/path/host

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
Posted by: Guest on August-07-2021

C# Answers by Framework

Browse Popular Code Answers by Language