Try this:
string baseUrl = Request.Url.Scheme + "://" + Request.Url.Authority +
Request.ApplicationPath.TrimEnd("https://stackoverflow.com/") + "https://stackoverflow.com/";
More Related Contents:
- How does Request.IsAuthenticated work?
- Registering an Application to a URI Scheme in windows 10
- How to display words that appear more than 'x' times in a text? [closed]
- how to get Value that cause exception
- Annual calender in asp.net page [closed]
- How do I run this code
- Can I automatically increment the file build version when using Visual Studio?
- Create an array or List of all dates between two dates [duplicate]
- How to write a simple Html.DropDownListFor()?
- ASP.NET MVC 5 group of radio buttons
- An ASP.NET setting has been detected that does not apply in Integrated managed pipeline mode
- How do I connect to an .mdf (Microsoft SQL Server Database File) in a simple web project?
- “The LINQ expression node type ‘Invoke’ is not supported in LINQ to Entities” – stumped!
- how to find control in edit item template?
- Do I have to Close() a SQLConnection before it gets disposed?
- Can “EndResponse” increase performance of ASP.Net page
- Convert a string’s character encoding from windows-1252 to utf-8
- Why do we need a private constructor?
- Get UserID of logged-in user in Asp.Net MVC 5
- Server tags cannot contain constructs
- Can I use ASP.NET MVC together with regular ASP.NET Web forms
- How to use Property Injection with AutoFac?
- pass jquery json into asp.net httphandler
- HttpWebRequests sends parameterless URI in Authorization header
- Making an entire row clickable in a gridview
- Explicit construction of entity type [MyClass] in query is not allowed
- Web Service without adding a reference?
- How to maintain the value of label after postback in Asp.net? [closed]
- How do I call a method in a Master Page from a content’s code-behind page?
- Why are Static Methods not Usable as Web Service Operations in ASMX Web Services?