Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var data = {
- 'Name': 'Apple',
- 'Type': 'Fruit',
- 'RemarksList': [
- {
- 'Parameter': 'test 1',
- 'Comments': 'test 123'
- },
- {
- 'Parameter': 'test 2',
- 'Comments': 'abc 3455'
- }
- ]
- };
- var url = "/Controller/Action";
- $.ajax({
- url: url,
- type: 'POST',
- dataType: 'application/json',
- data: data,
- success: function (data) {
- }
- });
- [HttpPost]
- public ActionResult Save(Model model)
- {
- return View();
- }
- public class Model
- {
- public int Id { get; set; }
- public string Name { get; set; }
- public string Type{ get; set; }
- public List<Remarks> RemarksList { get; set; }
- }
- public class Remarks
- {
- public int Id { get; set; }
- public string Parameter { get; set; }
- public string Comments { get; set; }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement