Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @model Cars.Web_New.Models.DropDownViewModel
- @using (Ajax.BeginForm("SelectModel", "Home", new AjaxOptions()
- {
- HttpMethod = "POST",
- InsertionMode = InsertionMode.Replace,
- UpdateTargetId = "years",
- OnSuccess = "UpdateModelsHiddenForms('SelectedModelId', 'model-input')"
- }, new { id = "model-dropdown" }))
- {
- @Html.DropDownListFor(
- m => m.SelectedModelId,
- new SelectList(Model.Models, "Id", "Name"),
- new { id = "model-input" }
- )
- }
- <script>
- $("#model-input").change(function () {
- $("#model-dropdown").submit();
- });
- </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement