title: Why do I get NullReferenceException when loading controls using LoadControl(string VirtualPath)?
body: <p>I have a test project which is part of a solution that I am trying to unit test. One of the methods that I want to test loads custom controls using the method <code>TemplateControl.LoadControl(string virtualPath)</code> e.g. </p>
  
  <pre><code>LoadControl(“~/CustomControl/Action/FitlerBox.ascx”) 
  </code></pre>
  
  <p>My problem is when I call this method from the Test project, it always returns a <code>NullReferenceException</code>. This is because it never finds the path, I think. </p>
  
  <p>Any suggestions on how to get this path?</p>