Advertisement
Guest User

Untitled

a guest
Oct 1st, 2015
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.63 KB | None | 0 0
  1. @model Cars.Web_New.Models.DropDownViewModel
  2.  
  3. @using (Ajax.BeginForm("SelectModel", "Home", new AjaxOptions()
  4. {
  5. HttpMethod = "POST",
  6. InsertionMode = InsertionMode.Replace,
  7. UpdateTargetId = "years",
  8. OnSuccess = "UpdateModelsHiddenForms('SelectedModelId', 'model-input')"
  9.  
  10. }, new { id = "model-dropdown" }))
  11. {
  12. @Html.DropDownListFor(
  13. m => m.SelectedModelId,
  14. new SelectList(Model.Models, "Id", "Name"),
  15. new { id = "model-input" }
  16. )
  17. }
  18.  
  19.  
  20. <script>
  21.  
  22. $("#model-input").change(function () {
  23. $("#model-dropdown").submit();
  24. });
  25.  
  26. </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement