title: c# postback dropdownlist always choose first value
body: <p>I want to insert the selected item of drop down list into database but my drop down list keep returns  the first option . auto post back is false . 
  codes here : </p>
  
  <p>dropTask() =  drop down list where I populate it from database.</p>
  
  <pre><code>        protected void Page_Load(object sender, EventArgs e)
      {
          if (!Page.IsPostBack)
          {
              dropTask();
          }
  
  
      }
  
      protected void AjaxFileUpload1_UploadComplete(object sender, AjaxControlToolkit.AjaxFileUploadEventArgs e)
      {
  
  
          String pathdirectory = (dropListActivity.SelectedItem.Text+"/");
          String filepathImage = (pathdirectory + e.FileName);
  
          EnsureDirectoriesExist(pathdirectory);
  
          AjaxFileUpload1.SaveAs(Server.MapPath(filepathImage));
  
  
          Session["filepathImage"] = filepathImage;
  
      }
  </code></pre>
  
  <p>i had checked the value return from drop down list using label :</p>
  
  <pre><code>   protected void btnDone_Click(object sender, EventArgs e)
      {
          if (Session["filepathImage"] != null)
          {
              string filepathImage = Session["filepathImage"] as string;
  
  
              Label1.Text = filepathImage;
  
          }
  
      }
  </code></pre>
  
  <p>the label text show the first option of the drop down list value instead of the choice I have chosen . Please enlighten me on this .</p>
  
  <p>ASPX:</p>
  
  <pre><code>&lt;tr&gt;
      &lt;td&gt;
          &lt;h2&gt;Upload your Story!&lt;/h2&gt;
          &lt;asp:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server"&gt;
          &lt;/asp:ToolkitScriptManager&gt;
  
      &lt;/td&gt;
  &lt;/tr&gt;
  
  &lt;tr&gt;
  &lt;td colspan = "2"&gt;&lt;/td&gt;
  &lt;/tr&gt;
  
  &lt;tr&gt;
      &lt;td&gt;
          &lt;b&gt;Select Activity:&lt;/b&gt;
      &lt;/td&gt;
      &lt;td&gt; 
  
          &lt;asp:DropDownList ID="dropListActivity" runat="server" 
              onselectedindexchanged="dropListActivity_SelectedIndexChanged"&gt;
          &lt;/asp:DropDownList&gt;
  
  
      &lt;/td&gt;
  
  &lt;/tr&gt;
  
  &lt;tr&gt;
  &lt;td colspan = "2"&gt;&lt;/td&gt;
  &lt;/tr&gt;
  
  &lt;tr&gt;
      &lt;td&gt;
          &lt;b&gt;Story Title:&lt;/b&gt;
      &lt;/td&gt;
      &lt;td&gt;
          &lt;asp:TextBox ID="txtStoryTitle" runat="server" 
              ontextchanged="txtTitle_TextChanged" AutoPostBack="True"&gt;&lt;/asp:TextBox&gt;
      &lt;/td&gt;
  &lt;/tr&gt;
  
  &lt;tr&gt;
      &lt;td class="style1"&gt;
            &lt;b&gt;Upload your files here:&lt;/b&gt;&lt;br /&gt;
            Multiple Images and 1 Audio file only.
      &lt;/td&gt;
      &lt;td class="style1"&gt;
          &lt;asp:AjaxFileUpload ID="AjaxFileUpload1" runat="server" 
              onuploadcomplete="AjaxFileUpload1_UploadComplete" 
               /&gt; 
      &lt;/td&gt;
  &lt;/tr&gt;
  
  &lt;tr&gt;
  &lt;td colspan = "2"&gt;&lt;/td&gt;
  &lt;/tr&gt;
  
  &lt;tr&gt;
      &lt;td&gt;
          &lt;asp:Label ID="Label1" runat="server" &gt;&lt;/asp:Label&gt;
      &lt;/td&gt;
  
      &lt;td&gt;
          &lt;asp:Button ID="btnDone" runat="server" Text="Done" onclick="btnDone_Click" /&gt;
      &lt;/td&gt;
  &lt;/tr&gt;
  </code></pre>