title: LoadControl on control with assembly reference
body: <p>I'm trying to use System.Web.UI.TemplateControl.LoadControl to build a templated web part for a SharePoint application, and I'm having trouble with a control that references an external assembly.</p>
  
  <p>I have a user control with the first few lines like this:</p>
  
  <pre><code>&lt;%@ Control Language="C#" ClassName="MyControl" %&gt;
  &lt;%@ Assembly Name="AjaxControlToolkit" %&gt;
  &lt;%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %&gt;
  </code></pre>
  
  <p>The web part derives from a base webpart that implements the templating and some other utilities which is in an assembly called "MyWebParts" (for example), while the derived web part class is in "MyProject".  MyProject has a reference to "MyWebParts" (obviously), and to "AjaxControlToolkit", but "MyWebParts" does not have a reference to "AjaxControlToolkit".  At runtime, when the templated web part tries to load the user control (a .ascx file in the "controltemplates" SharePoint root folder), it calls the base methods it inherited across assemblies, and it throws an HttpParseException, indicating that it couldn't load a required assembly.  The EventViewer confirms that the assembly in question is AjaxControlToolkit.</p>
  
  <p>I tried adding the AjaxControlToolkit assembly to the web.config for sharepoint, and it's sitting in the GAC, but to no avail.</p>
  
  <p>Anyone know how I can do this without having a reference to every assembly in existence in my "MyWebParts" assembly?</p>