title: How Can I Find The Path To A Folder from a Controller Constructor in ASP.NET MVC?
body: <p>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:</p>
  
  <pre><code>public TestController:Controller{
      string temp;
  
      public TestController(){
          temp = "";
          }
  
      }
  </code></pre>
  
  <p>I have tried the following:</p>
  
  <pre><code>temp = Server.MapPath("~/TheFolder/"); // Server is null - error.
  temp = Request.PhysicalApplicationPath + @"TheFolder\"; // Request is null - error.
  </code></pre>
  
  <p>Any ideas?</p>