I do not know the names of your methods, divs, just change accordingly if this helps. Try the following:
$("#DateDiv").datepicker({ showOtherMonths: true, selectOtherMonths: true, dateFormat: "yy/mm/dd", onSelect: function (dateText, inst) { UpdateGraph(dateText); }, onChangeMonthYear: function(year, month, inst) { $.ajax({ async: false, cache: false, contentType: "application/json; charset=utf-8", dataType: "json", url: "@Url.Action("LoadGraph", "YourController")", data: { date: new Date(year, month - 1, 1).toString("yyyy/MM/dd") }, success: function (data) { $("#UpdateGraphDataDiv").html(data); }, error: function (request, status, error) { DisplayErrorMessageBox(ParseErrorFromResponse(request.responseText, "Unknown error"), true); } }); }
source share