title: post back of Dropdownlist in web user control all other fields become empty
body: <p>i have a aspx page in which i have placeholder inside the panel</p>
  
  <p>as</p>
  
  <pre><code>&lt;div&gt;
      &lt;div&gt;
          &lt;div&gt;
              &lt;div&gt;
                  &lt;div&gt;
                      &lt;div&gt;
                          &lt;asp:UpdatePanel runat="server" ID="UpdatePanelLinks"&gt;
                              &lt;ContentTemplate&gt;
                                  &lt;center&gt;
                                      &lt;asp:Button Text="ADD" ID="btnAdd" runat="server" Width="100" OnClick="btnAdd_Click" /&gt;&amp;nbsp;
                                      &lt;asp:Button Text="Edit" ID="btnEdit" runat="server" Width="100" OnClick="btnEdit_Click" /&gt;&amp;nbsp;
                                      &lt;asp:Button Text="Delete" ID="btnDelete" runat="server" Width="100" OnClick="btnDelete_Click" /&gt;&lt;/center&gt;
                                  &lt;asp:LinkButton ID="usercontroldata" runat="server" Text="Branches" 
                                      OnClick="usercontrol_Click"&gt;&lt;/asp:LinkButton&gt;
                              &lt;/ContentTemplate&gt;
                          &lt;/asp:UpdatePanel&gt;
                      &lt;/div&gt;
                  &lt;/div&gt;
                  &lt;div &gt;
                      &lt;asp:LinkButton ID="lnkDepartments" runat="server" Text="Departments" OnClick="lnkDepartments_Click"&gt;&lt;/asp:LinkButton&gt;
                  &lt;/div&gt;
                  &lt;div &gt;
                  &lt;/div&gt;
                  &lt;div &gt;
                      &lt;asp:LinkButton ID="lnkProjects" runat="server" Text="Projects" OnClick="lnkProjects_Click"&gt;&lt;/asp:LinkButton&gt;
                  &lt;/div&gt;
                  &lt;div &gt;
                  &lt;/div&gt;
                  &lt;div &gt;
                      &amp;nbsp;
                  &lt;/div&gt;                       
              &lt;/div&gt;
              &lt;div&gt;
                  &lt;div&gt;
                      &lt;asp:Label Text="" Visible="false" ID="lblmessage" runat="server" /&gt;
                      &lt;div&gt;
                          &lt;asp:UpdatePanel ID="UpdatePanel" runat="server"&gt;
                              &lt;Triggers&gt;
                                  &lt;asp:AsyncPostBackTrigger ControlID="lnkBranches" EventName="Click" /&gt;
                                  &lt;asp:AsyncPostBackTrigger ControlID="lnkDepartments" /&gt;
                                  &lt;asp:AsyncPostBackTrigger ControlID="lnkProjects" /&gt;
                                  &lt;asp:AsyncPostBackTrigger ControlID="btnAdd" /&gt;
                                  &lt;asp:AsyncPostBackTrigger ControlID="btnEdit" /&gt;
                                  &lt;asp:AsyncPostBackTrigger ControlID="btnDelete" /&gt;
                              &lt;/Triggers&gt;
                              &lt;ContentTemplate&gt;
                                  &lt;asp:Panel runat="server" ID="MainPanel"&gt;
                                      &lt;div class="padding_branch"&gt;
                                          &lt;asp:PlaceHolder ID="PlaceHolder1" runat="server"&gt;&lt;/asp:PlaceHolder&gt;
                                      &lt;/div&gt;
                                  &lt;/asp:Panel&gt;
                              &lt;/ContentTemplate&gt;
                          &lt;/asp:UpdatePanel&gt;
                      &lt;/div&gt;
                  &lt;/div&gt;
              &lt;/div&gt;
          &lt;/div&gt;
      &lt;/div&gt;
  &lt;/div&gt;
  &lt;asp:UpdatePanel ID="UpdatePanel" runat="server"&gt;
      &lt;Triggers&gt;
          &lt;asp:AsyncPostBackTrigger ControlID="lnkBranches" EventName="Click" /&gt;
          &lt;asp:AsyncPostBackTrigger ControlID="lnkDepartments" /&gt;
          &lt;asp:AsyncPostBackTrigger ControlID="lnkProjects" /&gt;
          &lt;asp:AsyncPostBackTrigger ControlID="btnAdd" /&gt;
          &lt;asp:AsyncPostBackTrigger ControlID="btnEdit" /&gt;
          &lt;asp:AsyncPostBackTrigger ControlID="btnDelete" /&gt;
      &lt;/Triggers&gt;
      &lt;ContentTemplate&gt;
          &lt;asp:Panel runat="server" ID="MainPanel"&gt;
              &lt;div &gt;
                  &lt;asp:PlaceHolder ID="PlaceHolder1" runat="server"&gt;&lt;/asp:PlaceHolder&gt;                                     
              &lt;/div&gt;
          &lt;/asp:Panel&gt;
      &lt;/ContentTemplate&gt;
  &lt;/asp:UpdatePanel&gt;    
  </code></pre>
  
  <p>and on the aspx.cs page i am dynamically add the web user control on click of links</p>
  
  <p>and on the add button click the new user control is loaded</p>
  
  <pre><code> protected void usercontrol_Click(object sender, EventArgs e)
   {
          if (ViewState["controlname"] != null)
          {
              PlaceHolder pl = MainPanel.FindControl(ViewState["controlname"].ToString()) as PlaceHolder;
              if (pl.Controls.Count &gt; 0)
              {
                  pl.Controls.RemoveAt(0);
              }
          }
  
          Control uc = (Control)Page.LoadControl("~/usercontrol_Data.ascx");
  
          ViewState["path"] = "~/usercontrol_Data.ascx";
          ViewState["controlname"] = "PlaceHolder1";
          ViewState["name"] = "usercontrol";
          PlaceHolder1.Controls.Add(uc);
   }
  </code></pre>
  
  <p>i am also mainaining the web user control on Page_Load</p>
  
  <pre><code>        if (Page.IsPostBack)
          {
              if (ViewState["path"] != null)
              {
                  Control uc1 = (Control)Page.LoadControl(ViewState["path"].ToString());
  
                  PlaceHolder pl = MainPanel.FindControl(ViewState["controlname"].ToString()) as PlaceHolder;
                  pl.Controls.Add(uc1);
              }
          }
  </code></pre>
  
  <p>and there is dropdown list on the form user control when iam selecting any of the option from the user control it post back and all the other fields become empty for textboxes etc . this happans for the first time and for next time all the fields retain there values</p>
  
  <p>please help</p>
  
  <p>thanks</p>