ARTICLE
MaskedEdit Control in Ajax
MaskedEdit Control is edit field control. We can crate with TextBox control.
Introduction : MaskedEdit Control is
edit field control that can be attached to a TextBox control.With the help of
this control we create a template of user entry of information such as Number,
ID.
MaskedEditValidators Extenders control help user enter the correct data and
support more complex rule.
Properties of MaskEdit Control.
- Mask.
- MaskType.
- MessageValidatorTip.
- UserDateFormate.
- UserTimeFormate.
- AutoCompleteValue.
- Century.
- PromptChararacter.
Step : 1 Open Visual Studio and go to
File menu option.
- Select WebSite option.
- Select ASP.NET Web Site.

Step : 2 Go to Solution Explorer
and right click. - Select Add New Items.
- Select Web Form.
- Go to Source menu option.

Step : 3 Drag and Drop Control in
ToolBox.
- Drag TextBox, MaskedEdit, MaskedEditValidator control.
- Write a code.
Code :
<title>masked
control</title>
</head>
<body>
<form id="form1" runat="server">
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<div>
date <asp:TextBox ID="TextBox1" runat="server" Width = "70px" BackColor = "Azure"></asp:TextBox><br />
<asp:MaskedEditExtender ID="MaskedEditExtender1" runat="server" TargetControlID = "TextBox1" MaskType ="Date" Mask="99/99/9999"
ClearTextOnInvalid = "true" PromptCharacter = "_" ></asp:MaskedEditExtender>
<asp:MaskedEditValidator ID="MaskedEditValidator1" runat="server" ControlExtender = "MaskedEditExtender1"
ControlToValidate = "TextBox1"
EmptyValueMessage = "required date"
ValidationExpression = "valid date"
IsValidEmpty =
"false" TooltipMessage = "input a data" Display = "None"></asp:MaskedEditValidator>
</div>
</form>
</body>
</html>
Step : 4 Press F5 and
run.

Step : 5 Now we click on TextBox and write a date.
