I want to get Url of the page like abc.aspx. how can i get this using code behind technique. Any idea.?
Full Details, you can later use string Operations for advanced manipulation:
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
How to get the URL of the current page in C#
Use Request.RawUrl
:
Gets the raw URL of the current request.
Request.RawUrl
property gives you the fully qualified URL of your current page
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With