Home > DeveloperSection > Articles > AJAX Control Toolkit: MaskedEditExtender and MaskedEditValidator

AJAX Control Toolkit: MaskedEditExtender and MaskedEditValidator


AJAX AJAX 
Ratings:
0 Comment(s)
 18696  View(s)
Rate this:

AJAX Control Toolkit: MaskedEditExtender and MaskedEditValidator


MaskedEditExtender: It restricts the end user from entering specific text within textbox control.

It contains main key properties TargetControlID and MaskType (this property indicates the type of mask or filter to place on the textbox. In MaskType, there are possible values:

None: No validation will be performed.

Date: Date validation will occur.

Date Time: Date and Time validation will occur.

Number: A number validation will exist.

Time: A time validation will occur.

 

MaskedEditValidator: It work with above control and it show the massage on incorrect input. It has important key properties as ControlExtender,  ControlToValidate, Display etc.

How we implement the Update Progress server control

 

Example:

Step1: we use the following control on aspx page

 

<div>

<%--Using ScriptManager or ToolkitScriptManager according toolkit version--%>

<asp:ScriptManager ID="ScriptManager1" runat="server">

</asp:ScriptManager>

<%-- add the MaskedEditExtender and MaskedEditValidator--%>

<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>

<cc1:MaskedEditExtender ID="MaskedEditExtender1" runat="server" TargetControlID="TextBox1" MaskType="number" Mask="9999"  UserDateFormat="MonthDayYear"></cc1:MaskedEditExtender>       

<cc1:MaskedEditValidator ID="MaskedEditValidator1" runat="server" ControlToValidate="TextBox1" IsValidEmpty="false"

ControlExtender="MaskedEditExtender1"  Display="Dynamic" EmptyValueMessage="Enter correct format">

</cc1:MaskedEditValidator>

</div>

 

Step2: Run the project

Enter the value

If we do not enter the value

 

 

 

 

 


Don't want to miss updates? Please click the below button!

Follow MindStick