MaskedEditExtender MaskType Number in asp.net ajax

Ajax MaskedEditExtender MaskType Number - How to use mask Number
UsingMaskTypeNumber.aspx
<%@ Page Language="C#" AutoEventWireup="true" %>
<%@ Import Namespace="System.Drawing" %>

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

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<script runat="server">
    protected void Page_Load(object sender, EventArgs e)
    {
        if(!Page.IsPostBack)
        {
            Button1.Font.Bold = true;
            Button1.ForeColor = Color.OliveDrab;
            Button1.Height = 40;
            Label1.ForeColor = Color.MediumSeaGreen;
            Label1.Font.Size = FontUnit.XLarge;
        }
    }
    protected void Button1_Click(object sender, EventArgs e)
    {
        Label1.Text = "You submitted age: " + TextBox1.Text;
    }
</script>
<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="Head1" runat="server">
    <title>Ajax MaskedEditExtender MaskType Number - How to use mask Number</title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <h2 style="color:SlateBlue; font-style:italic;">Ajax MaskedEditValidator Example: MaskType Number</h2>
        <hr width="550" align="left" color="Pink" />
        <asp:ScriptManager 
            ID="ScriptManager1"
            runat="server"
            >
        </asp:ScriptManager>
        <br /><br />
        <asp:Label 
            ID="Label1"
            runat="server"
            >
        </asp:Label>
        <br /><br />
        <asp:Label 
            ID="Label2"
            runat="server"
            Text="Your Age [999 Format]"
            ForeColor="Orange"
            Font-Bold="true"
            >
        </asp:Label>
        <br />
        <asp:TextBox 
            ID="TextBox1"
            runat="server"
            Font-Bold="true"
            ForeColor="HotPink"
            Font-Size="Large"
            Font-Names="Comic Sans MS"
            >
        </asp:TextBox>
        <cc1:MaskedEditExtender 
            ID="MaskedEditExtender1"
            runat="server"
            TargetControlID="TextBox1"
            Mask="999"
            MaskType="Number"
            MessageValidatorTip="true"
            >
        </cc1:MaskedEditExtender>
        <cc1:MaskedEditValidator 
            ID="MaskedEditValidator1"
            runat="server"
            ControlToValidate="TextBox1"
            ControlExtender="MaskedEditExtender1"
            IsValidEmpty="false"
            EmptyValueMessage="Input age"
            InvalidValueMessage="inputted age not valid"
            MaximumValue="120"
            MinimumValue="18"
            MaximumValueMessage="Age must be <120"
            MinimumValueMessage="Age must be >18"
            >
        </cc1:MaskedEditValidator>
        <br /><br />
        <asp:Button 
            ID="Button1"
            runat="server"
            Text="Submit Your Age"
            OnClick="Button1_Click"
            />
    </div>
    </form>
</body>
</html>








Related asp.net example