I have a json object like this :
var data = {};
data =
{ "First" : _this.getFirstElement.val(),
"Second": _this.getSecondElement.val(),
"DateProperty" : _this.getDatePropertyElement.val()
};
This is passed to the controller method using jquery post :
$.post(url,data,function(){somefunction});
My controller method is like this :
[HttpPost]
public void ControllerMethod(TestObject data)
{
// data.DateProperty is coming as null
// logic
}
What did i miss?
The FormData passed when looked in the network section of browser specifies data as :
FormData :
First : <some data>
Second : <some data>
DateProperty : some long date string
Later i changed json data to send date as JSON.stringify()
Now in the formData , value is coming as
First : <some data>
Second : <some data>
DateProperty : "05/06/16"
But still at Controller method, dateProperty is null ?