简体   繁体   English

如何在ASP.NET中验证日历控件

[英]How to validate calendar control in asp.net

I'm using Asp.net and c# as my back end and I want to validate my check_in and check_out date in such a way that it the check_in is not before check_out and also check_in and check_out calendar controls cannot be blank, thanks. 我正在使用Asp.net和c#作为后端,我想通过以下方式验证我的check_in和check_out日期,即check_in不在check_out之前,而且check_in和check_out日历控件不能为空,谢谢。

.aspx page .aspx页面

<asp:Calendar ID="checkin" runat="server"></asp:Calendar>

<asp:Calendar ID="checkout" runat="server"></asp:Calendar>
            if (checkin.SelectedDate > checkout.SelectedDate)
            {
               // Not Valid
            }

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM