Answers for "asp.net core get root url in view"

C#
0

mvc get base url

Request.Url.GetLeftPart(UriPartial.Authority) + Url.Content("~")
Posted by: Guest on August-11-2020
0

asp.net core get root url in view

FOR ASP.NET CORE:
public WhateverController(IHttpContextAccessor context) //In the constructor
{
  var request = context.HttpContext.Request;
  var _baseURL = $"{request.Scheme}://{request.Host}"; // http://localhost:5000
}
Posted by: Guest on November-24-2020

Code answers related to "asp.net core get root url in view"

C# Answers by Framework

Browse Popular Code Answers by Language