More
Image
How to Retrieve the Current Domain in ASP.NET MVC
By Adi.jc On 11 May 2016
Categories: MVC

public ActionResult Index()

{

string Domain = Request.Url.Scheme + System.Uri.SchemeDelimiter + Request.Url.Host + (Request.Url.IsDefaultPort ? "" : ":" + Request.Url.Port);

return View(Domain);

}

 


Comments
Message :
Comments
Adi.jc
.net
.net