我正在尝试使用带有 asp.net 日历控件的 jquery 更改年份和月份,但我无法更改年份。可能是压光机控制属性有问题。
以下是我的代码
$(document).ready(function () {
var cyear = $('#<%=Ddyear.ClientID %>');
var cmonth = $('#<%=Ddmonth.ClientID %>');
var cal = $('#<%=Calendar1.ClientID %>');
cyear.change(function () {
var item = cyear.val();
var item2 = cmonth.val();
item = item + ',' + item2;
$.ajax({
type: "POST",
url: "dashboardQuery.aspx/calanderdates",
data: '{item:"' + item + '"}',
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function (response) {
var sdate = Date.parse(response.d, "MM/dd/yyyy");
dates = sdate;
$('#<%=Calendar1.ClientID %>').attr('VisibleDate', sDate);
},
error: function () {
alert(msg.status);
}
});
});
});