上面例子中的 FilteredTextBox 控件代码将被初始化如下:
<ajaxToolkit:FilteredTextBoxExtender ID="ftbe" runat="server"
TargetControlID="TextBox3"
FilterType="Custom, Numbers"
ValidChars="+-=/*()." />
- TargetControlID - 需要具有“过滤”功能的 TextBox 控件 ID
- FilterType - 被约束的方式,包括:
Numbers, LowercaseLetters, UppercaseLetters, 和 Custom; 可以采用逗号(,)进行组合。
如果指定了 Custom,那么 ValidChars 属性将被用于指定有效的字符。
- FilterMode - 采用的约束模式,可以是 ValidChars (默认) 或者
InvalidChars。如果被设置为 InvalidChars,那么 FilterType 必须被设置为Custom;如果被设置为ValidChars,
那么 FilterType 必须包含 Custom。
- ValidChars - 一个用字符串表示的有效字符集合,如果没有在 FilterType 设置了 Custom,那么该设置将会被忽略。
- InvalidChars - 一个用字符串表示的非法字符集合,如果没有在 FilterType 设置了 Custom ,那么该设置将会被忽略。
- FilterInterval - 一个用整数标示的产生“过滤”时间间隔,用毫秒表示,默认为250(毫秒)。