Advertisement
Guest User

Untitled

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