Jump to content

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


rhishi20
 Share

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:MaskedEditExtender>

 

<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 comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...