Advertisement
Guest User

Untitled

a guest
Oct 28th, 2016
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.75 KB | None | 0 0
  1. [HttpPost]
  2. public async Task<IActionResult> GetDocument(SearchFiltersModel filters)
  3. {
  4. var model = await _service.GetDocument(filters);
  5. TempData["Detail"] = model;
  6. return Json("document/detail/" + model.DocumentID)
  7. }
  8.  
  9. [HttpGet]
  10. public IActionResult Detail(int id)
  11. {
  12. // getting error at line below.
  13. /// ArgumentNullException: Value cannot be null. Parameter name: dictionary
  14.  
  15. var model = TempData["Detail"] as DocumentModel;
  16. return View(model);
  17. }
  18.  
  19. $('btn').click(function(){
  20.  
  21. $.ajax({
  22. type: 'POST',
  23. data: filters,
  24. url: 'document/getdocument'
  25. })
  26. .done(function (response) {
  27. window.location = response;
  28. })
  29. })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement