MaskedEdit

<%@ Page Language="C#" MasterPageFile="~/Default.master" AutoEventWireup="true" CodeFile="MaskedEdit.aspx.cs" Inherits="MaskedEdit" Title="Untitled Page" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    MaskType: Date, mask: 99/99/9999
    <br />
    <asp:TextBox ID="TextBox1" runat="server" ValidationGroup="Demo1" Width="328px"></asp:TextBox><br />
    <ajaxToolkit:MaskedEditExtender ID="MaskedEditExtender1" runat="server" AcceptNegative="Left"
        DisplayMoney="Left" Mask="99/99/9999" MaskType="Date" MessageValidatorTip="true"
        OnFocusCssClass="MaskedEditFocus" OnInvalidCssClass="MaskedEditError" TargetControlID="TextBox1" CultureName="en-US" AutoComplete="true" AutoCompleteValue="05/23/1964">
    </ajaxToolkit:MaskedEditExtender>
    <ajaxToolkit:MaskedEditValidator ID="MaskedEditValidator1" runat="server" ControlExtender="MaskedEditExtender1"
        ControlToValidate="TextBox1" Display="Dynamic" IsValidEmpty="False" MaximumValue="01/01/2010"
        EmptyValueMessage="Date is required" InvalidValueMessage="Date is invalid" MaximumValueMessage="Message Max"
        MinimumValueMessage="Message Min" TooltipMessage="Input a Date" MinimumValue="02/02/1900" ValidationGroup="Demo1"></ajaxToolkit:MaskedEditValidator>

    MaskType: number, mask: 999,999.99<br />
    <asp:TextBox ID="TextBox2" runat="server" MaxLength="1" ValidationGroup="Demo1" Width="328px"></asp:TextBox><br />
    <ajaxToolkit:MaskedEditExtender ID="MaskedEditExtender2" runat="server" Mask="999,999.99" MaskType="Number" MessageValidatorTip="true"
        OnFocusCssClass="MaskedEditFocus" OnInvalidCssClass="MaskedEditError" TargetControlID="TextBox2" CultureName="pt-BR">
    </ajaxToolkit:MaskedEditExtender>
    <ajaxToolkit:MaskedEditValidator ID="MaskedEditValidator2" runat="server" ControlExtender="MaskedEditExtender2"
        ControlToValidate="TextBox2" Display="Dynamic" IsValidEmpty="False" EmptyValueMessage="Message Empty"
         InvalidValueMessage="Message Invalid" TooltipMessage="Input a number" ValidationGroup="Demo1" MaximumValue="20000" MaximumValueMessage="Message Max" MinimumValue="100" MinimumValueMessage="Message Min" ></ajaxToolkit:MaskedEditValidator>
    &nbsp; MaskType: time mask: 99:99:99<br />
    <asp:TextBox ID="TextBox3" runat="server" MaxLength="1" ValidationGroup="Demo1" Width="328px"></asp:TextBox><br />
    <ajaxToolkit:MaskedEditExtender ID="MaskedEditExtender3" runat="server"  AcceptAmPm="false"
        Mask="99:99:99" MaskType="Time" MessageValidatorTip="true" OnFocusCssClass="MaskedEditFocus" OnInvalidCssClass="MaskedEditError" TargetControlID="TextBox3" CultureName="pt-BR">
    </ajaxToolkit:MaskedEditExtender>
    <ajaxToolkit:MaskedEditValidator ID="MaskedEditValidator3" runat="server" ControlExtender="MaskedEditExtender3"
        ControlToValidate="TextBox3" Display="Dynamic" IsValidEmpty="False" MinimumValue="03:30:00" MaximumValue="18:00:00"
        EmptyValueMessage="Message Empty" InvalidValueMessage="Message Invalid" MaximumValueMessage="Message Max"
        MinimumValueMessage="Message Min" TooltipMessage="Input a Time" ValidationGroup="Demo1"></ajaxToolkit:MaskedEditValidator>

    &nbsp; &nbsp; MaskType: none mask: ?{30}<br />
    <asp:TextBox ID="TextBox4" runat="server" MaxLength="1" ValidationGroup="Demo1" Width="328px"></asp:TextBox><br />
    <ajaxToolkit:MaskedEditExtender ID="MaskedEditExtender4" runat="server"  AcceptAmPm="true"
        Mask="?{30}" MessageValidatorTip="true" OnFocusCssClass="MaskedEditFocus" OnInvalidCssClass="MaskedEditError" TargetControlID="TextBox4">
    </ajaxToolkit:MaskedEditExtender>
    <ajaxToolkit:MaskedEditValidator ID="MaskedEditValidator4" runat="server" ControlExtender="MaskedEditExtender4"
        ControlToValidate="TextBox4" Display="Dynamic" IsValidEmpty="False"
        EmptyValueMessage="Message Empty" InvalidValueMessage="Message Invalid" MaximumValueMessage="Message Max"
        MinimumValueMessage="Message Min" TooltipMessage="Input a Text" MinimumValue="3" ValidationGroup="Demo1"></ajaxToolkit:MaskedEditValidator>
   
</asp:Content>

没有更多推荐了,返回首页