【发布时间】:2017-12-14 09:40:18
【问题描述】:
我在更新面板中有名为“txtExploitDate”的文本框。在按钮单击时,我已将文本框的默认值设置为昨天的日期。我在下面编写了 jquery 代码来将 datepicker 与文本框绑定。但是,当我从 datepicker 中选择日期时,它会在文本框中重新显示日期,然后再次更改为默认日期。
<script type="text/javascript">
//$(document).ready(function DatePickerExploitDate() {
// $(function () {
// $("#txtExploitDate").datepicker();
// });
//});
$(document).ready(function () {
ApplyDatePicker();
Sys.WebForms.PageRequestManager.getInstance().add_endRequest(ApplyDatePicker);
});
function ApplyDatePicker() {
$('#txtExploitDate').datepicker();
}
</script>
请忽略注释代码,因为我之前在我的文本框不在更新面板中时使用它,但当时有回发问题,所以我将我的文本框放在更新面板中并更改了我的 jquery 代码。
请帮帮我。
【问题讨论】: