title: Loading ASP.NET User Controls By Type And Passing Parameters?
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/240850/asp-net-usercontrol-loadcontrol-issue">Asp.net Usercontrol LoadControl Issue</a>  </p>
  </blockquote>
  
  
  
  <p>In ASP.NET 2.0 it is my understanding that although the API existed for loading a user control by type, it didn't actually work. </p>
  
  <p>Or at least I never managed to get it to work, and I know from blogs that others have had similar issues.</p>
  
  <p>So I use a wrapper type that provides the functionality I need, invoking the relevant control constructor using reflection.</p>
  
  <p>Has ASP.NET 3.5 made the loading of user controls by type and passing in parameters any easier?</p>
  
  <p>Edit:</p>
  
  <p>Further clarification....</p>
  
  <p>There are two overloads for the TemplateControl.LoadControl method:</p>
  
  <pre><code>Control TemplateControl.LoadControl(Type t, object[] params) and,
  
  Control TemplateControl.LoadControl(string virtualPath)
  </code></pre>
  
  <p>My question is; in ASP.NET 2.0 the first overload didn't seem to work. Does anyone know if this method truly didn't work, and if so has it been fixed in ASP.NET 3.5.</p>
  
  <p>I'll be testing this myself tomorrow, and will update the question with the answer if noone else knows.</p>