<asp:textbox id="TextBox1" runat="server"></asp:textbox> <cc1:filteredtextboxextender id="FilteredTextBoxExtender1" runat="server" validchars="10" targetcontrolid="TextBox1" > </cc1:filteredtextboxextender>
KeyPress
protected void YourTextBox_KeyPress(object sender, KeyPressEventArgs e) { var allowKeys = new[] { Keys.Back, Keys.D0, Keys.D1 }; e.Handled = !allowKeys .Contains((Keys)e.KeyChar); }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)