Guest User

Untitled

a guest
Jun 18th, 2018
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.72 KB | None | 0 0
  1. <div id="ajaxIT">
  2. @Html.Partial("AddRepField", Model)
  3. </div>
  4. <input type="submit" name="Add" value="add" class="btn-sm btn-default" />}
  5.  
  6. public ActionResult Add(EventDetailsViewModel viewModel)
  7. {
  8. if (viewModel.Event.Repertoires == null)
  9. {
  10. viewModel.Event.Repertoires = new List<Repertoire>();
  11. }
  12. viewModel.Event.Repertoires.Add(new Repertoire());
  13. return PartialView("AddRepField", viewModel);
  14. }
  15.  
  16. <script src="~/Scripts/jquery.unobtrusive-ajax.min.js"></script>
  17.  
  18. <script src="~/Scripts/jquery.unobtrusive-ajax.js"></script>
  19.  
  20. @using (Ajax.BeginForm("Add", "Repertoire", new AjaxOptions { UpdateTargetId = "ajaxIT" })) {
  21. ...
  22. }
Add Comment
Please, Sign In to add comment