更改为选定值时更新会话变量值MVC5

时间:2019-01-28 10:07:10

标签: asp.net-mvc-5

更改下拉值后,我需要更新会话变量

   <select id="dropdownID"  class="form-control select2" 
   style="height:50px;">
       @foreach (var item in (Session["DisplayList"] as List<Customer>))
         {
          <option value = "@Url.Action("ChoosingProfil","Account", new { customerId = item.Id})">

 @((string)string.Concat(item.Code, " ", item.Designation, " ", item.Town))
 </option>
  }
  </select>

和javascript

  <script>

   $(document).ready(function(){

       $('#dropdownID').change(function(e){
           window.location = $(this).val();
         });

   });

0 个答案:

没有答案