c# mvc get base url in view code example Example: mvc get base url Request.Url.GetLeftPart(UriPartial.Authority) + Url.Content("~")