[Progress Communities] [Progress OpenEdge ABL] Forum Post: RE: How to Post json data to MVC controller

  • Thread starter hugo.aguirre@bray.com
  • Start date
Status
Not open for further replies.
H

hugo.aguirre@bray.com

Guest
public JsonResult CreateCustomer(string email, string planid) { string s = "test"; return Json(s); } You cant receive multiple parameters in post method you need create a class or get into dynamic object like public JsonResult CreateCustomer(Dynamic parameters) { string email = parameters.email; string planId = parameters.plan.Id; return Json(email + planId); } The best way is creating a class: Public Class Whatever { public string email {get;set;} public string planId {get;set;} } public JsonResult CreateCustomer(Whatever parameters) { string email = parameters.email; string planId = parameters.plan.Id; return Json(email + planId); } Try it.

Continue reading...
 
Status
Not open for further replies.
Top