Any way to get the current screen name of asp.net without hard coding?
string ScreenName = HttpContext.Current.Request.Url.AbsoluteUri;
I tried this and got the full url.
Any way to get the current screen name of asp.net without hard coding?
string ScreenName = HttpContext.Current.Request.Url.AbsoluteUri;
I tried this and got the full url.
2
Answers
I found a code. For me the
string path
is goodIf you want to get the domain name from the url, use the following code:
or :
where "sURL" is your URL.