title: Dropdown Returning Wrong value asp.net server control
body: <p>I have a drop down web server control which is binded with datasource from database ..when i select a value it always return value of first item in list on button click please resolve this issue..here is the code using </p>
  
  <pre><code>using JobPortel.DTO;
  using System;
  using System.Collections.Generic;
  using System.Linq;
  using System.Web;
  using System.Web.UI;
  using System.Web.UI.WebControls;
  
  namespace JobPortel
  {
      public partial class receivedresume : System.Web.UI.Page
      {
          MemberDTO memberobj;
          int orgid;
          Utilities util;
          String jobidString;
          List&lt;JobDto&gt; joblist;
          protected void Page_Load(object sender, EventArgs e)
          {
              String UserName = (String)Session["UserName"];
              util = new Utilities();
              memberobj = util.getMember(UserName);
              orgid = util.getOrganizationIdFromMember(memberobj.ID);
  
                  joblist = util.getJobList(orgid);
                  this.joblistdropdown.DataSource = joblist;
                  joblistdropdown.DataTextField = "Jobtitle";
                  joblistdropdown.DataValueField = "Id";
                  this.joblistdropdown.DataBind();
              }
  
              if (IsPostBack) {
  
                   jobidString = this.joblistdropdown.SelectedValue;
              }
          }
          protected void savebtn_Click(object sender, EventArgs e)
          {
              int jobid = 0;
  
               jobid = Convert.ToInt32(jobidString);
  
  
              List&lt;MemberDTO&gt; cvlist = new List&lt;MemberDTO&gt;();
  
              using (var db = new jobportaldatabaseEntities1()) {
  
                  var query = from m in db.Members
                              join p in db.applyjobtables on m.Id equals p.applicantid
                              where p.jobid == jobid
                              select m;
                  foreach (var item in query)
                  {
                      MemberDTO member = new MemberDTO();
                      member.ID = item.Id;
                      member.FirstName = item.firstname;
                      member.Lastname = item.lastname;
                      member.Location = item.location;
                      member.Mobile = item.mobile;
                      member.Email = item.email;
                      cvlist.Add(member);
                  }
              }
              this.cvgridview.DataSource = cvlist;
              this.cvgridview.DataBind();
          }
  
  
      }
  }
  </code></pre>