SyntaxFix
Write A Post
Hire A Developer
Questions
You can try the following code :
Request.Url.Host + (Request.Url.IsDefaultPort ? "" : ":" + Request.Url.Port)