Ajax CalendarExtender使用上一年 [英] Ajax CalendarExtender take previous year
本文介绍了Ajax CalendarExtender使用上一年的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
您好
我有一个与文本框关联的Ajax CalendarExtender..
Hi
i have one Ajax CalendarExtender associated with a text box..
<asp:TextBox ID="txtFromDate" runat="server" CssClass="inp-form" EnableViewState ="false" />
<asp:CalendarExtender ID="CalendarExtenderFromDate" OnClientDateSelectionChanged="CloseCalenderUI"
runat="server" TargetControlID="txtFromDate" Format="MM/dd/yyyy" EnableViewState ="false">
</asp:CalendarExtender>
我选择一个日期,例如"01/25/2012",然后将其手动更改为"01/25/1111"
通过Java脚本验证,我将od文本框的值清除为''''
当我再次单击txt框时,日历显示年份为1111,我希望日历显示当前日期..
i select a date like ''01/25/2012'' and manually change it to ''01/25/1111''
by java script validation i clear the value od text box to ''''
When i again click txt box the calender show year as 1111 i want calender show current date..
推荐答案
嗨
试试以下
Hi
Try the following
<asp:CalendarExtender ID="CalendarExtenderFromDate" OnClientDateSelectionChanged="CloseCalenderUI"
runat="server" TargetControlID="txtFromDate" Format="MM/dd/yyyy" EnableViewState ="false" SelectedDate='<%#System.DateTime.Now%>'
</asp:CalendarExtender>
希望这对您有帮助
Hope this helps
设置
CalendarExtender1.SelectedDate = DateTime.Now.Date
在您的加载页面中设置日历日期.
in your load page to set the calendar date .
这篇关于Ajax CalendarExtender使用上一年的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文