Ajax controltoolkit Learning Log-filteredtextboxextender (12)

Source: Internet
Author: User
The filtertextboxextender control is used to filter the text box, so that the text box can only enter the set value. The input types include numbers, lowercaseletters, uppercaseletters, and customer.

First, let's look at an example:

1) Create an ASP. NET Ajax-enabled web project in Vs and name it filtertextboxextender1.

2) add four label labels and four textbox on the default. aspx page to enter numbers, lowercase letters, uppercase letters, and symbols.

CodeAs follows: 1 < ASP: Label ID = "Label1" Runat = "Server" Text = "Number" > </ ASP: Label >
2 < ASP: textbox ID = "Number" Runat = "Server" > </ ASP: textbox >
3 < BR />
4 < BR />
5 < ASP: Label ID = "Label2" Runat = "Server" Text = "Lowercaseletters" > </ ASP: Label >
6 < ASP: textbox ID = "Lowercaseletters" Runat = "Server" > </ ASP: textbox >
7 < BR />
8 < BR />
9 < ASP: Label ID = "Label3" Runat = "Server" Text = "Uppercaseletters" > </ ASP: Label >
10 < ASP: textbox ID = "Uppercaseletters" Runat = "Server" > </ ASP: textbox >
11 < BR />
12 < BR />
13 < ASP: Label ID = "Label4" Runat = "Server" Text = "Customer (+-= .)" > </ ASP: Label >
14 & Nbsp;   & Nbsp; < ASP: textbox ID = "Customer" Runat = "Server" > </ ASP: textbox > < BR />

3) Add a filteredtextboxextender control to each text box on the page and set the corresponding properties.

The Code is as follows:

1 < C0: filteredtextboxextender ID = "Filteredtextboxextender1" Targetcontrolid = "Number" Filtertype = "Numbers" Runat = "Server" > </ C0: filteredtextboxextender >
2 < C0: filteredtextboxextender ID = "Filteredtextboxextender2" Targetcontrolid = "Lowercaseletters" Filtertype = "Lowercaseletters" Runat = "Server" > </ C0: filteredtextboxextender >
3 < C0: filteredtextboxextender ID = "Filteredtextboxextender3" Targetcontrolid = "Uppercaseletters" Filtertype = "Uppercaseletters" Runat = "Server" > </ C0: filteredtextboxextender >
4 < C0: filteredtextboxextender ID = "Filteredtextboxextender4" Targetcontrolid = "Customer" Filtertype = "Custom" Validchars = "+-= ." Runat = "Server" > </ C0: filteredtextboxextender >
5

Attribute description:
Targetcontrolid: enter a text box.
Filtertype: Specifies the input type. There are numbers, lowercaseletters, uppercaseletters, and customer.
Validchars: if it is set as customer in filtertype, you need to set some content you want to enter in this attribute.

4) press Ctrl + F5 to view the information in the browser.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.