---
title: "AJAX Control Toolkit: MaskedEditExtender and MaskedEditValidator"  
description: "MaskedEditExtender:  It restricts the end user from entering specific text within textbox control.  It contains main key properties TargetControlID an"  
author: "Uttam Misra"  
published: 2010-09-25  
updated: 2020-03-04  
canonical: https://www.mindstick.com/articles/142/ajax-control-toolkit-maskededitextender-and-maskededitvalidator  
category: "ajax"  
tags: ["ajax"]  
reading_time: 1 minute  

---

# AJAX Control Toolkit: MaskedEditExtender and MaskedEditValidator

MaskedEditExtender: It restricts the end user from entering specific text within [textbox control](https://www.mindstick.com/articles/320/textbox-control-in-vb-dot-net).\

It contains main key [properties](https://yourviews.mindstick.com/view/81845/now-it-s-possible-to-predict-properties-of-any-molecule) TargetControlID and MaskType (this [property](https://www.mindstick.com/articles/198559/an-ownership-of-property-in-hua-hin) indicates the type of mask or filter to place on the textbox. In MaskType, there are [possible values](https://www.mindstick.com/forum/23337/hibernate-hbm2ddl-auto-possible-values-and-what-they-do):

None: No [validation](https://www.mindstick.com/articles/43/validation-controls-in-asp-dot-net) will be performed.

Date: Date validation will occur.

[Date Time](https://www.mindstick.com/blog/386/retrieve-sql-server-installation-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](https://yourviews.mindstick.com/view/88472/the-compromise-between-comfort-and-progress) server control

Example:

**Step1:** we use the following control on [aspx page](https://www.mindstick.com/forum/218/how-do-i-create-an-aspx-page-that-periodically-refreshes-itself)

```
 <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](https://yourviews.mindstick.com/story/1788/things-to-ensure-your-construction-project-is-successful)

![AJAX Control Toolkit: MaskedEditExtender and MaskedEditValidator](https://www.mindstick.com/mindstickarticle/68f9f213-e099-40e6-b8c3-caf75067b66a/images/4337fd82-fce8-4168-beee-b77620f4538f.png)

Enter the value

![AJAX Control Toolkit: MaskedEditExtender and MaskedEditValidator](https://www.mindstick.com/mindstickarticle/68f9f213-e099-40e6-b8c3-caf75067b66a/images/314609c5-3da5-4fec-b189-d7264c2d838f.png)

If we do not enter the value

![AJAX Control Toolkit: MaskedEditExtender and MaskedEditValidator](https://www.mindstick.com/mindstickarticle/68f9f213-e099-40e6-b8c3-caf75067b66a/images/5c017438-c63f-4bb0-ab82-43272340e318.png)

---

Original Source: https://www.mindstick.com/articles/142/ajax-control-toolkit-maskededitextender-and-maskededitvalidator

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
