title: Retain dropdownlist selected value after post to controller
body: <p>I have dropdownlist in my view and load this dropdown with values from controller. On change event I need to pass data to controller, after that the dropdownlist loaded fresh. But I want to keep the selected value after post to controller. My jQuery is following :</p>
  
  <pre><code>$.ajax({ 
          url: "/TimesheetModels/GetUsersForTimesheet",
          type: "Get", 
          success: function (data) {
              for (var i = 0; i &lt; data.length; i++) {                
                  opt =  new Option(data[i].First_Name, data[i].EmpId);
                  $('#ddlUsers').append(opt); //Load drodown list while page load
              } 
          } 
      });
  
   $('#ddlUsers').change(function () {
          alert($(this).val());
          var empId = $(this).val();
          startDate = $('#calendar').fullCalendar('getDate').startOf('week');
          window.location.href = "/TimesheetModels/TimesheetApproval?selectDate=" + convertDate(startDate) + "&amp;empId=" + empId; //Pass data to controller
          alert(empId); // i get this alert before pass to controller
           $('#ddlUsers').val(empId);
      });
  </code></pre>
  
  <p>In controller i have this aciton,</p>
  
  <pre><code> public ActionResult TimesheetApproval(string SelectDate,string empId)
          {
              DateTime startDate;
              if (!DateTime.TryParse(SelectDate, out startDate))
                  startDate = DateTime.Today.AddDays(-(int)DateTime.Today.DayOfWeek);
  
              int EmpId;
              if (empId != null)
                  EmpId = Convert.ToInt32(empId);
              else
              {
                   EmpId = Convert.ToInt32(Session["EmpId"].ToString());
              }
  
              string startDateCalendar = Convert.ToString(startDate.ToString("ddd MMM dd yyyy HH:mm:ss")) + " GMT+0530";
              ViewData["startDateCalendar"] = startDateCalendar;
  
              DateTime endDate = startDate.AddDays(6);
  
  
              List&lt;TimesheetMatrix&gt; _timesheetList = _timesheetDetailViewModel.GetAllProjectTasks(startDate, endDate, EmpId);
  
  
              return View(_timesheetList);
          }
  </code></pre>
  
  <p>Can anyone help me to solve this?</p>