<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default4.aspx.cs" Inherits="Default4" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<style>
.demoarea {
padding:20px;
background:#FFF url(images/demotop.png) no-repeat left top;
}
.demoarea p
{
padding:5px;
}
</style>
</head>
<body>
<form id="form1" runat="server">
<asp:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server">
</asp:ToolkitScriptManager>
<div class="demoarea">
<div class="demoheading">FilteredTextBox Demonstration</div>
<table border="0">
<tr>
<td>Only digits are allowed here:</td>
<td><asp:TextBox ID="TextBox1" runat="server" /></td>
</tr>
<tr>
<td>Only lower-case letters are allowed here:</td>
<td><asp:TextBox ID="TextBox2" runat="server" /></td>
</tr>
<tr>
<td>Only math symbols (+,-,*,/,=,.) and numbers:</td>
<td><asp:TextBox ID="TextBox3" runat="server" /></td>
</tr>
<tr>
<td>No digits allowed in this textbox:</td>
<td><asp:TextBox ID="TextBox4" runat="server" /></td>
</tr>
</table>
<asp:FilteredTextBoxExtender
ID="FilteredTextBoxExtender1"
runat="server"
TargetControlID="TextBox1"
FilterType="Numbers" />
<asp:FilteredTextBoxExtender
ID="FilteredTextBoxExtender2"
runat="server"
TargetControlID="TextBox2"
FilterType="LowercaseLetters" />
<asp:FilteredTextBoxExtender
ID="FilteredTextBoxExtender3"
runat="server"
TargetControlID="TextBox3"
FilterType="Custom, Numbers"
ValidChars="+-=/*()." />
<asp:FilteredTextBoxExtender
ID="FilteredTextBoxExtender4"
runat="server"
TargetControlID="TextBox4"
FilterType="Custom"
FilterMode="InvalidChars"
InvalidChars="1234567890" />
</div>
</form>
</body>
</html>
No comments:
Post a Comment