asp.net - mvc with ajax post -


i have form includes list of records. when user clicks edit image on table modal div show him. modal div ajax. after changing fields posting via ajax. watched firebug. sends parameter. when debug code in vs method calls no parameter has been send. have done before in other pages. can not. problem can here in code?

c# code here

 [httppost]  //[authorize(roles = "operator")]  public actionresult editrow(string name, string secondname)  {               //code goes here     return content("saved");  } 

jquery ajax code here

  $.ajax({        type: 'post',        contenttype: 'application/json; charset=utf-8',        url: 'editrow',        data: { name: "php", secondname: "mvc" },        datatype: 'html',        success: function (response) {         //some code goes here        }       }); 

have tried simplify ajax call to:

$.ajax({     type: 'post',     url: 'editrow',     data: { name: "php", secondname: "mvc" },     success: function (response) {         //some code goes here     } }); 

if doesn't work there must else in code makes code invalid. maybe base controller action filters forgot put there or custom model binders or other global registration.

sending complex json server

if you'd send complex json using same technique, can read my blog post , use simple plugin make possible send complex json objects asp.net mvc controller action.


Comments

Popular posts from this blog

java - SNMP4J General Variable Binding Error -

sql server - python to mssql encoding problem -

windows - Python Service Installation - "Could not find PythonClass entry" -