Base solution for your next web application
Starts in:
01 DAYS
01 HRS
01 MIN
01 SEC
Open Closed

I'm sure this is something really dumb question, but how can I read WebSiteRootAddress in a controller to build a link? #9149


User avatar
0
marble68 created

But in the MVC, I want to get a setting while in a controller.

I'm running 8.7, Jquery

Specifically, I'm after the setting WebSiteRootAddress

somthing like:


string myUrl = "";
string myUrl += <get WebSiteRootAddress from appsettings.json>; // <-- How do I do this?
string myUrl += "/Take/" + employee.Id;
ViewBag.myUrl = myUrl;

Thanks.


1 Answer(s)
  • User Avatar
    0
    maliming created
    Support Team

    hi

    You can use IWebUrlService.