title: Can't maintain the dynamic dropdown selected value after postback
body: <p>Am using the below code to create a multiple drop down list. But i can't able to maintain the previous selected value. Please help me to maintain the previous vaues.</p>
  
  <p>My code is Here:</p>
  
  <pre><code>        for (int i = 1; i &lt;= Count; i++)
          {
              Session["i"] = Count;
  
              Panel1.Controls.Add(new LiteralControl("&lt;br /&gt;"));
              Label lbl = new Label();
              lbl.ID = "lbl" + i;
              lbl.Text = "Head";
              Panel1.Controls.Add(lbl);
              Panel1.Controls.Add(new LiteralControl("&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;"));
  
              DropDownList ddl = new DropDownList();
              ddl.ID = "ID" + i;
              ddl.DataValueField = "fld_Head";
              ddl.DataTextField = "fld_Head";
              ddl.DataSource = DVS;
              ddl.DataBind();
              Panel1.Controls.Add(ddl);
          }
  </code></pre>