I am posting a json message from javascript, and same i am trying to read it in the controller method. In the action method i am not able to convert the data object to json format, please guide me how do i convert it back to json message.
var jsonmsg = {
"Id": "0AJK11",
"date": "2011082512560500",
"accountsno": "12",
"childItems": [
{ "account": "King", "accountpart": "003333", "position": "1" },
{ "account": "Queene", "accountpart": "33333", "position": "2"},
{ "account": "Price", "accountpart": "", "position": "3"},
{ "account": "Jack", "accountpart": "", "position": "4"},
]
};
var url = '/ControllerName/MyAction';
$("#DialogDiv").load(url, {"data":jsonmsg});
$('#DialogDiv').dialog({
autoOpen: false,
width: 1000,
height: 500,
overflow:'auto',
resizable: false,
modal: true,
position:'top'
}).dialog('open');
public ActionResult MyAction(object data)
{
ViewBag.modelData = data;
return PartialView("_AccountView");
}