c# - pass javascript model to controller -


I do not know what I'm missing. I have a javascript model that I'm making here, its Is there a demoded down version, does anyone see why my model is not being sent to my controller with data?

JavaScript model that is being created: (it populates correctly)

  var myModel = {ThresholdDetailId: thresholdDetailID, thresholdId: threshold id, owner name: owner name , SelectedEnodeType: SelectedEnodeType, GroupID: GroupId}   

Ajax call:

  $. Ajax (reference: this, type: 'post', url: '/ threshold / editingtrrayhold /', data: {model: mymold}, success: function (result) {// do stuff}, error: work () { Error () ;}});   

The model is empty whenever the action is taken on the controller.

Here is the signature:

  [http post] Public JsonResult EditThreshold {ThreadholdDetail Model} {// Do Stuff}    

do not wrap myModel with an model property in an external object (unless That view modell is not binding you ultimately is set in the same way, which seems likely):

  $ Ajax (reference: this, type: 'post', url: '/ threshold / editingtravel /', data: mamold, // & lt; ------- success: function (results) {// do stuff }, Error: Work () {Error ();}});    

Comments

Popular posts from this blog

php - PDO bindParam() fatal error -

logging - How can I log both the Request.InputStream and Response.OutputStream traffic in my ASP.NET MVC3 Application for specific Actions? -

java - Why my included JSP file won't get processed correctly? -