How to insert valid date in textbox in Asp.net using C#

Posted by Unknown On Friday, 4 October 2013 0 comments
Hi, In this post i describe that how to select the particular valid date from calendar extendar user
not allow to enter invalid date.

For That you have to just use the some ajax control like following way.
before use you have to register the ajax toolkit and put the tool script manager in your code.

<asp:TextBox ID="txtbx_registrationdate" runat="server" CssClass="textbox"  TabIndex="11"></asp:TextBox>

<asp:CalendarExtender ID="CalendarExtender1" runat="server" TargetControlID="txtbx_registrationdate"></asp:CalendarExtender>


<asp:MaskedEditExtender ID="MaskedEditExtender32" runat="server" MaskType="Date" Mask="99/99/9999" TargetControlID="txtbx_registrationdate"> </asp:MaskedEditExtender>
                                       
<asp:MaskedEditValidator ID="MaskedEditValidator12" runat="server" ControlExtender="MaskedEditExtender32" ControlToValidate="txtbx_registrationdate" IsValidEmpty="false" InvalidValueMessage="Invalid Date" ToolTip="Input Date in MM/dd/YYYY Format"  Display="Dynamic"  ValidationGroup="Sub" />

0 comments:

Post a Comment