I am trying to get the path to a folder in my website root and save it to a class property when my controller constructor is called:
public TestController:Controller{
string temp;
public TestController(){
temp = "";
}
}
I have tried the following:
temp = Server.MapPath("~/TheFolder/"); // Server is null - error.
temp = Request.PhysicalApplicationPath + @"TheFolder\"; // Request is null - error.
Any ideas?