两个日历扩展器 [英] two calendar extender
本文介绍了两个日历扩展器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
嗨
在我的dotnet应用程序中,我有两个日历扩展程序(ajax工具套件).
到达日期和离开日期.
在我选择到达日期之后,我不想允许选择到达日期之前的离开日期.我该怎么办?
谢谢
afsal
解决方案
按照&调用CompareValidator通过以下方式比较两个日期
< asp:TextBox 运行 =" ID =" MyTextBoxArrivalDate" < > < asp:Label ID =" runat 服务器" 文本 (dd/MM/yyyy)" ">< /asp:Label > < ajax:CalendarExtender ID =" TargetControlID MyTextBoxArrivalDate " Format =" 运行 =" / >> < asp:TextBox 运行 =" ID MyTextBoxDepartureDate " < > < asp:Label ID =" runat 服务器" 文本 (dd/MM/yyyy)" ">< /asp:Label > < ajax:CalendarExtender ID =" TargetControlID MyTextBoxDepartureDate " Format =" 运行 =" / >> < br/ > < asp:CompareValidator ID =" runat =" 服务器" ErrorMessage =" ControlToCompare =" ControlToValidate =" ValueToCompare =" MyTextBoxArrivalDate" 操作员 =" 类型 =" ValidationGroup =" NameOfValidationGroup" > < /asp:CompareValidator >
请注意设置CampareValidator的ValidationGroup属性的适当值
这可能对您有帮助
(" span>).datepicker({ dateFormat:' yy-mm-dd', numberOfMonths: 1 , onSelect:功能(已选中){
Hi
In my dotnet application i am having two calendar extender(ajax tool kit).
arrival date and departure date.
after i select arrival date , i do not want to allow to select departure date before the arrival date. how can i do that?
thanks
afsal解决方案Rewrite tax of calender extenders following way & call CompareValidator to compare two dates in following ways
<asp:TextBox runat="server" ID="MyTextBoxArrivalDate"></asp:TextBox> <asp:Label ID="LabelArrival" runat="server" Text="(dd/MM/yyyy)"></asp:Label> <ajax:CalendarExtender ID="MyTextBoxArrivalDate" TargetControlID="MyTextBoxArrivalDate" Format="dd/MM/yyyy" runat="server" /> <asp:TextBox runat="server" ID="MyTextBoxDepartureDate"></asp:TextBox> <asp:Label ID="LabelDeparture" runat="server" Text="(dd/MM/yyyy)"></asp:Label> <ajax:CalendarExtender ID="MyTextBoxDepartureDate" TargetControlID="MyTextBoxDepartureDate" Format="dd/MM/yyyy" runat="server" /> <br/> <asp:CompareValidator ID="cmpEndDate" runat="server" ErrorMessage="Date range not valid." ControlToCompare="MyTextBoxArrivalDate" ControlToValidate="MyTextBoxDepartureDate" ValueToCompare="MyTextBoxArrivalDate" Operator="GreaterThanEqual" Type="Date" ValidationGroup="NameOfValidationGroup"></asp:CompareValidator>
Note set appropriate value of ValidationGroup property of CampareValidator
This may help you
("#txtArrivalDate").datepicker({ dateFormat: 'yy-mm-dd', numberOfMonths: 1, onSelect: function (selected) {
这篇关于两个日历扩展器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文