Jump to content

want to place a date in dd/MMM/yyyy format while using maskeditvalidator

Recommended Posts

I have a Textbox which accepts Date. I have use maskeditextender and maskeditvalidator from ajax.


following is the code:


<asp:MaskedEditExtender ID="MaskedEditExtender1" TargetControlID="txtBdate" CultureName="en-GB" MaskType="Date" Mask="99/LLL/9999" OnInvalidCssClass="error1" UserDateFormat="DayMonthYear" runat="server">


<asp:MaskedEditValidator ID="MaskedEditValidator1" ControlToValidate="txtBdate" ControlExtender="MaskedEditExtender1" InvalidValueMessage="wrong date" TooltipMessage="Please Enter Date in DD/MMM/YYYY Format" ValidationExpression="^(0?[1-9]|[12][0-9]|3[01])-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(19|20)dd$" runat="server"></asp:MaskedEditValidator>


I want to write date in dd/MMM/yyyy (12/Aug/1988) this format. you can see that, i have use regular expression for validating dd/MMM/yyyy format. but textbox is not accepting date in dd/MMM/yyyy format.


i have also tried to change culture from en-us to en-Gb in web.config but not getting success. please tell me how to solve this problem.

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...