asp.net - How to use Mask in MaskedEditExtender

MaskedEditExtender Mask
Default.aspx

<%@ Page Language="C#" AutoEventWireup="true" %>
<%@ Import Namespace="System.Drawing" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>

<!DOCTYPE html>

<script runat="server">
    protected void Page_Load(object sender, EventArgs e)
    {
        if(!Page.IsPostBack)
        {
            TextBox1.ForeColor = Color.DeepPink;
            TextBox1.BackColor = Color.Snow;
            TextBox1.Font.Name = "Verdana";
            TextBox1.Font.Size = FontUnit.Large;
            TextBox1.Height = 35;
        }
    }
    protected void Button1_Click(object sender, EventArgs e)
    {
        Label1.Text = "You submitted date: ";
        Label1.Text += Convert.ToDateTime(TextBox1.Text).ToLongDateString();
    }
</script>

<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="Head1" runat="server">
    <title>Ajax MaskedEditExtender Mask - How to use Mask in MaskedEditExtender</title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <h2 style="color:RosyBrown; font-style:italic;">Ajax MaskedEditValidator Example: Using Mask</h2>
        <hr width="475" align="left" color="BurlyWood" />
        <asp:ScriptManager 
            ID="ScriptManager1"
            runat="server"
            >
        </asp:ScriptManager>
        <br /><br />
        <asp:Label 
            ID="Label1"
            runat="server"
            Font-Size="X-Large"
            ForeColor="Olive"
            >
        </asp:Label>
        <br /><br />
        <asp:Label 
            ID="Label2"
            runat="server"
            Text="Input a date [99/99/9999][mm/dd/yyyy] "
            ForeColor="SkyBlue"
            Font-Bold="true"
            >
        </asp:Label>
        <br />
        <asp:TextBox 
            ID="TextBox1"
            runat="server"
            >
        </asp:TextBox>
        <cc1:MaskedEditExtender 
            ID="MaskedEditExtender1"
            runat="server"
            TargetControlID="TextBox1"
            Mask="99/99/9999"
            MaskType="Date"
            MessageValidatorTip="true"
            >
        </cc1:MaskedEditExtender>
        <cc1:MaskedEditValidator 
            ID="MaskedEditValidator1"
            runat="server"
            ControlToValidate="TextBox1"
            ControlExtender="MaskedEditExtender1"
            IsValidEmpty="false"
            EmptyValueMessage="Input date"
            InvalidValueMessage="inputted date not valid"
            >
        </cc1:MaskedEditValidator>
        <br /><br />
        <asp:Button 
            ID="Button1"
            runat="server"
            Text="Submit Your Date"            
            Font-Bold="true"
            ForeColor="DeepPink"
            OnClick="Button1_Click"
            Height="40"
            />
    </div>
    </form>
</body>
</html>
More asp.net ajax examples