How Do I: Use the ASP.NET AJAX FilteredTextbox Extender?

The FilteredTextbox Extender control enables the Textbox server control of ASP.Net to filter the input given by user that allows only valid input characters into the textbox. You can use the FilteredTextboxExtender for the field of username to validate and filter the invalid characters e.g.: allows the input characters as alphabets + special characters (- or _) + numbers.

There is a limitation of using FilteredTextboxExtender that user can disable the javascript feature of web browser. This allows the user to input any invalid characters. So, you cannot rely totally on this extender control. You must also verify the input before saving it into the data store otherwise it could cause exceptions later on.
FilteredTextboxExtender Properties

TargetControlID: ID of Textbox control to bind the FilteredTextboxExtender with it.

FilterType: There are four types of filters Custom, LowercaseLetters, Numbers, UppercaseLetters. You can specify one of these filters or comma-separated combinations.If FilterType is set as Custom then you must specify the character ValidChars also.

FilterMode: There are two types of filter mode ValidChars, InvalidChars.ValidChars FilterMode works with FilterType having combination of filters and must contain Custom. You must also specify the valid characters in ValidChars property. InvalidChars FilterMode works only with Custom FilterType.

ValidChars: List of valid characters. ValidChars property works only if FilterType contains Custom otherwise it is ignored.

InvalidChars: List of invalid characters. Invalid property works with Custom FilterType. Also you must select the InvalidChars FilterMode.

FilterInterval: Time in milliseconds to filter the invalid characters within the specified time interval. Default value is 250 milliseconds.

Sample Code:

Hiç yorum yok:

Visual Studio 2017'de Devexpress 17.2.5 Toolbox görünmüyor

Visual Studio 2017 Toolbox'ı üzerinde Developer Express componentlerini göremiyorsanız aşağıdaki komutu çalıştırmak işini görecektir. (...