title: Load user control dynamically with parameters
body: <p>I've created a user control.</p>
  <pre><code>public partial class Controls_pageGeneral : System.Web.UI.UserControl
  {
  
      private int pageId;
      private int itemIndex;
  
      public int PageId
      {
          get { return pageId; }
          set { pageId = value; }
      }
  
      public int ItemIndex
      {
          get { return itemIndex; }
          set { itemIndex = value; }
      }
  
      protected void Page_Load(object sender, EventArgs e)
      {
          // something very cool happens here, according to the values of pageId and itemIndex
      }
  
  }
  </code></pre>
  <p>Now I want to <strong>dynamically</strong> create this control and pass it parameters.
  I've tried using the <code>LoadControl</code> function but it only has two constructor: one with string (path), and another with Type t and array of parameters.</p>
  <p>The first method works, but because of my parameters and have to use the more complicated method of <code>LoadControl</code>, but I don't get how to use it. How can I case my path string of my Control to that weird object Type t?</p>