Advertisement
Guest User

Untitled

a guest
Feb 9th, 2016
47
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.08 KB | None | 0 0
  1. var data = {
  2. 'Name': 'Apple',
  3. 'Type': 'Fruit',
  4. 'RemarksList': [
  5. {
  6. 'Parameter': 'test 1',
  7. 'Comments': 'test 123'
  8. },
  9. {
  10. 'Parameter': 'test 2',
  11. 'Comments': 'abc 3455'
  12. }
  13. ]
  14. };
  15.  
  16.  
  17.  
  18. var url = "/Controller/Action";
  19.  
  20. $.ajax({
  21. url: url,
  22. type: 'POST',
  23. dataType: 'application/json',
  24. data: data,
  25. success: function (data) {
  26.  
  27. }
  28. });
  29.  
  30. [HttpPost]
  31. public ActionResult Save(Model model)
  32. {
  33. return View();
  34. }
  35.  
  36. public class Model
  37. {
  38. public int Id { get; set; }
  39. public string Name { get; set; }
  40. public string Type{ get; set; }
  41. public List<Remarks> RemarksList { get; set; }
  42. }
  43.  
  44. public class Remarks
  45. {
  46. public int Id { get; set; }
  47. public string Parameter { get; set; }
  48. public string Comments { get; set; }
  49. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement