Bhavna Chaudhri

Bhavna Chaudhri

  • NA
  • 529
  • 21.2k

Ajax post to Controller not working

Oct 17 2020 12:34 AM
Below is my code 
  1. var model = {  
  2.             Name: name,  
  3.            
  4.             Gender: gender,   
  5.             Subjects: subs  // array of Subject object (Id,Name)  
  6.            
  7.   
  8.         };  
  9.   
  10.         $.ajax({  
  11.             type: "post",  
  12.             url:"/home/Save",  
  13.             dataType: "json",  
  14.             contentType: "application/json;charset=utf-8",  
  15.             data:{Model:model},  
  16.             cache: false,  
  17.             success:function(){}  
  18.   
  19.         })  
 

Answers (1)