example of ajax control "FilteredTextBox" using asp.net
FilteredTextBox.aspx
<%@ Page Language="C#"
AutoEventWireup="true"
CodeFile="FilteredTextBox.aspx.cs"
Inherits="FilteredTextBox"
%>
<%@ 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>
</head>
<body>
<form id="form1" runat="server">
<asp:ToolkitScriptManager ID="ScriptManager1" runat="server"></asp:ToolkitScriptManager>
<div>
<asp:FilteredTextBoxExtender
ID="FilteredTextBoxExtender1" runat="server"
FilterType="Numbers"
TargetControlID="TextBox1">
</asp:FilteredTextBoxExtender>
<asp:FilteredTextBoxExtender
ID="FilteredTextBoxExtender2" runat="server"
FilterType="LowercaseLetters"
TargetControlID="TextBox2">
</asp:FilteredTextBoxExtender>
<asp:FilteredTextBoxExtender
ID="FilteredTextBoxExtender3" runat="server"
FilterType="UppercaseLetters"
TargetControlID="TextBox3">
</asp:FilteredTextBoxExtender>
<asp:FilteredTextBoxExtender
ID="FilteredTextBoxExtender4" runat="server"
FilterType="UppercaseLetters,LowercaseLetters"
TargetControlID="TextBox4">
</asp:FilteredTextBoxExtender>
<asp:FilteredTextBoxExtender
ID="FilteredTextBoxExtender5" runat="server"
FilterType="UppercaseLetters,Numbers"
TargetControlID="TextBox5">
</asp:FilteredTextBoxExtender>
number only <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox><br />
Lower Latters<asp:TextBox ID="TextBox2" runat="server"></asp:TextBox><br />
Upper Latters<asp:TextBox ID="TextBox3" runat="server"></asp:TextBox><br />
Lower Latters and Upper Latters<asp:TextBox ID="TextBox4"
runat="server"></asp:TextBox><br />
Upper Latters and numeric<asp:TextBox ID="TextBox5"
runat="server"></asp:TextBox>
</div>
</form>
</body>
</html>
FilteredTextBox.aspx.cs
using System;using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
public partial class FilteredTextBox : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
}
0 comments :