Validation for calendar control

Posted by Vijayar under C# on 7/28/2011 | Points: 10 | Views : 2560 | Status : [Member] | Replies : 2
Hi
I need a a validation for a ajax calendar control which accepts only dates i,e if we enter characters we should get a message that we should enter date only,Please help me in doing this.it's urgent
<asp:TextBox ID="txtcontractstart" CssClass="txtbox" runat="server"></asp:TextBox>
<cc1:CalendarExtender ID="CalendarExtender1" runat="server" Enabled="true" TargetControlID="txtcontractstart">
</cc1:CalendarExtender>

vijaya


Responses

Posted by: Vforvijay on: 7/28/2011 [Member] Starter | Points: 25

Up
0
Down
hi..You can use ajax maskeditextender and maskvalidextender for validating enter data in text box........
here textbox name is textbox1
<cc2:MaskedEditExtender ID="MaskedEditExtender1" runat="server" Mask="99/99/9999" MaskType="Date" TargetControlID="TextBox1" PromptCharacter="_"> </cc2:MaskedEditExtender>


<cc2:MaskedEditValidator ID="MaskedEditValidator1" runat="server" ControlExtender="MaskedEditExtender1" ControlToValidate="TextBox1" EmptyValueMessage="Date is required" InvalidValueMessage="Date is invalid" IsValidEmpty="False" TooltipMessage="Input a Date"></cc2:MaskedEditValidator>


Vijayar, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Xiaoyuandlg on: 5/22/2014 [Member] Starter | Points: 25

Up
0
Down
You may carefully check the tutorials for the calendar control:

http://www.kettic.com/winforms_ui/csharp_guide/calendar_get_started.shtml

Vijayar, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response