1
Answer

how can i pass datetime value to an action method by ajax

shosho s

shosho s

8y
288
1
function PassDateTime(date) {
$.ajax({
url: '@Url.Action("GetClientDateTime")',
data: { ClientSideTimeIn: date },
type: 'GET',
success: function (result) {
},
error: function (request, status, error) {
alert(request.responseText);
}
});
}
 
 im trying to pass the datetime value with the above ajax to an action method but i keep an error say:
 

The parameters dictionary contains a null entry for parameter 'timein' of non-nullable type 'System.DateTime' for method 'System.Web.Mvc.ActionResult GetClientDateTime(System.DateTime)' .....

 
how can i resolve this..please help 


 
 
 

Answers (1)