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


   Step1: we use the following control on aspx page

<%--Using ScriptManager or ToolkitScriptManager according toolkit version--%>
<asp:ScriptManager ID="ScriptManager1" runat="server">
<%-- 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">

   Step2: Run the project

AJAX Control Toolkit: MaskedEditExtender and MaskedEditValidator

Enter the value

AJAX Control Toolkit: MaskedEditExtender and MaskedEditValidator

If we do not enter the value

AJAX Control Toolkit: MaskedEditExtender and MaskedEditValidator


  Modified On Sep-07-2019 12:11:15 AM

Leave Comment