title: Dynamically loaded web user control hides on postback
body: <p>i have a web custom control </p>
  
  <pre><code>&lt;%@ Control Language="C#" AutoEventWireup="true" CodeBehind="WebUserControl1.ascx.cs"
      Inherits="WebApplication5.WebUserControl1" %&gt;
  &lt;asp:DropDownList ID="ddlnew" AutoPostBack="true" runat="server" 
      onselectedindexchanged="ddlnew_SelectedIndexChanged"&gt;
      &lt;asp:ListItem Text="text1" /&gt;
      &lt;asp:ListItem Text="text1" /&gt;
      &lt;asp:ListItem Text="text2" /&gt;
      &lt;asp:ListItem Text="text1" /&gt;
      &lt;asp:ListItem Text="text2" /&gt;
      &lt;asp:ListItem Text="text2" /&gt;
  &lt;/asp:DropDownList&gt;
  </code></pre>
  
  <p>and on the Default.aspx page </p>
  
  <p></p>
  
  <pre><code>&lt;asp:Button Text="PostBack" ID="btnPost" runat="server" 
  onclick="btnPost_Click" /&gt;
  </code></pre>
  
  <p>and on the Default.aspx.cs</p>
  
  <pre><code>    protected void btnPost_Click(object sender, EventArgs e)
      {
          WebUserControl1 uc =  (WebUserControl1)Page.LoadControl("~/WebUserControl1.ascx");
          PlaceHolder.Controls.Add(uc);
      }
  </code></pre>
  
  <p>and when we select any item from dropdown it postback and the control hide from the page </p>
  
  <p>so please help how it can be prevented from hide</p>
  
  <p>thanks</p>