Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSHARP

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
}
 
PREVIOUS NEXT
Tagged: #core #root #url #view
ADD COMMENT
Topic
Name
1+2 =