The MaskedEdit control is an ASP.NET AJAX control that can be attached to a TextBox control. The supported data formats are: Number, Date, Time, and DateTime. MaskedEdit uses the culture settings specified in the CultureName property. If none is specified the culture setting will be the same as the page: English (United States).
The MaskedEdit control has to be integrated with the MaskedEditValidator to verify the input.
It validates date formats entering. It is also used for time and number formats also.
Original Article from
www.codeforasp.net
Using Masked Edit Extender with calendar control
Step1: Open Visual Studio ,Create a new web Application (Ajax Enabled Application)
Step2: Check Script Manager is added or not in Default.aspx page. If it is not added
Drag script manager control from Ajax toolkit in Toolbox.
Step3: Add Textbox control , Ajax Calender Control, Ajax Maked Edit Extender control
step4: Set the Mask property to of the extender to ”99/99/9999″, MaskType property “Date”, TargetControlID to “TextBox1″
step5: MaskType property plays major role for Masked Edit Extender . It describes
Mask type date, number, time and Datetime
Mask=”99/99/9999″
MaskType=”Date”
TargetControlID=”TextBox1″
Step6: Then drag and drop MaskedEditValidator into the page. Set the properties of
the MaskedEditValidator as follows:
set properties
ControlExtender=”TextBox1_MaskedEditExtender”
ControlToValidate=”TextBox1″
Display=”Dynamic”
EmptyValueMessage=”A Date is Required”
Sample Code look like this:
<asp:TextBox ID=”TextBox1″ runat=”server” ></asp:TextBox>
<cc1:MaskedEditExtender ID=”TextBox1_MaskedEditExtender” runat=”server”
CultureName=”en-AU” Enabled=”True” Mask=”99/99/9999″ MaskType=”Date” TargetControlID=”TextBox1″/>
<cc1:MaskedEditValidator ID=”mev1″ runat=”server”
ControlExtender=”TextBox1_MaskedEditExtender” ControlToValidate=”TextBox1″
Display=”Dynamic”
EmptyValueMessage=”A Date is Required”
InvalidValueMessage=”The Date is Invalid”
IsValidEmpty=”False” TooltipMessage=”Please Enter a Date”/>
<cc1:CalendarExtender ID=”CalendarExtender1″ runat=”server” PopupButtonID=”TextBox1″ Format=”dd/MM/yyyy”
TargetControlID=”TextBox1″></cc1:CalendarExtender>
September 6, 2009 at 9:35 pm |
I’m so glad I found this site…Keep up the good work
September 20, 2009 at 12:30 pm |
Excellent site, keep up the good work. I read a lot of blogs on a daily basis and for the most part, people lack substance but, I just wanted to make a quick comment to say I’m glad I found your blog. Thanks,
A definite great read.. <a href="http://wiki.hudson-ci.org/display/~bill-bartmann"
-Bill-Bartmann
September 25, 2009 at 10:18 am |
There’s good info here. I did a search on the topic and found most people will agree with your blog. Keep up the good work mate!
October 1, 2009 at 4:20 am |
I usually don’t post on Blogs but ya forced me to, great info.. excellent! … I’ll add a backlink and bookmark your site.