title: using external project asp.NET user control (ascx) in Visual WebPart
body: <p>I'm new to sharepoint2010, I'm used to ASP web development.
  What I'm doing is referencing a .ascx from an external project as described in this Scott Guthrie article :
  <a href="http://webproject.scottgu.com/CSharp/UserControls/UserControls.aspx" rel="nofollow">http://webproject.scottgu.com/CSharp/UserControls/UserControls.aspx</a></p>
  
  <p>and also this article for MVP in SharePoint:
  <a href="http://www.henrycordes.nl/post/2009/04/29/Model-View-Presenter-design-pattern-in-Sharepoint.aspx" rel="nofollow">http://www.henrycordes.nl/post/2009/04/29/Model-View-Presenter-design-pattern-in-Sharepoint.aspx</a></p>
  
  <p>I have a test web application which has a project reference to the webControls (Ascx) library project and there is a prebuild line that copies over the ascx to a folder in the web application project.
  Then I reference the ascx control from the aspx page as per normal!</p>
  
  <p>BUT in SharePoint I try the same trick and get this error :</p>
  
  <p>" Parser Error
  Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately.</p>
  
  <p>Parser Error Message: The referenced file '/UserControls/Calculator.ascx' is not allowed on this page."</p>
  
  <p>In fact the path to the ascx is not being parsed at all, because if I change to a nonexisting directory I get the same error. Or if I copy the ascx to the '14' directory.</p>
  
  <p>What steps do I need to take to get this ascx deployed in SP2010?</p>
  
  <p>here is the lines I'm using to refrence the ascx in sp visual webpart code aspx page:</p>
  
  <pre><code>&lt;%@ Register tagPrefix="sjb" tagName="calc" src="~/UserControls/Calculator.ascx" %&gt;
  &lt;sjb:calc ID="calc" runat="server" /&gt;
  </code></pre>