Try this :
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
More Related Contents:
- c# asp.net delete last comma [closed]
- Days between two dates in asp.net
- how to get date difference between two dates using DateDiff Excluding the weekends [duplicate]
- Finding the variable name passed to a function
- The name ‘controlname’ does not exist in the current context
- How can I retrieve Id of inserted entity using Entity framework? [closed]
- Easiest way to parse JSON response
- Format excel column to decimal doing export from c#
- POSTing JsonObject With HttpClient From Web API
- Finding all positions of substring in a larger string in C#
- Getting data from stored procedure with Entity Framework
- How do I export to Excel?
- Make ASP.NET WCF convert dictionary to JSON, omitting “Key” & “Value” tags
- Force browser to download PDF document instead of opening it
- Visual Studio 2015 not syntax highlighting razor nor Intellisense
- How to access HTML form input from ASP.NET code behind
- How I can get web page’s content and save it into the string variable
- The request was aborted: Could not create SSL/TLS secure channel
- Capture username with log4net
- How can I add option groups in ASP.NET drop down list?
- SignalR doesn’t use Session on server
- onchange event for html.dropdownlist
- How to force BundleCollection to flush cached script bundles in MVC4
- How do I inject ASP.NET 5 (vNext) user-secrets into my own utility class?
- Tag helper not being processed in ASP.NET Core 2
- Filehandler in asp.net
- When to use Request.Cookies over Response.Cookies?
- ASP .NET Button event handlers do not fire on the first click, but on the second click after a PostBack
- SignalR – Checking if a user is still connected
- Get first element from a dictionary