`
lovnet
  • 浏览: 6692728 次
  • 性别: Icon_minigender_1
  • 来自: 武汉
文章分类
社区版块
存档分类
最新评论

altas(ajax)控件(十二):FilteredTextBox

阅读更多
FilteredTextBox控件是一个非常有用的控件,使用他能直接过滤一些字符。
例子:
一:只允许数字
<asp:TextBoxID="TextBox1"runat="server"/>
<ajaxToolkit:FilteredTextBoxExtender
ID="FilteredTextBoxExtender1"
runat
="server"
TargetControlID
="TextBox1"
FilterType
="Numbers"/>
二:只允许输入小字字母
<asp:TextBoxID="TextBox2"runat="server"/>
<ajaxToolkit:FilteredTextBoxExtender
ID="FilteredTextBoxExtender2"
runat
="server"
TargetControlID
="TextBox2"
FilterType
="LowercaseLetters"/>
三:只允许输入(+,-,*,/,=,.)和数字
<asp:TextBoxID="TextBox3"runat="server"/></td>
<ajaxToolkit:FilteredTextBoxExtender
ID="FilteredTextBoxExtender3"
runat
="server"
TargetControlID
="TextBox3"
FilterType
="Custom,Numbers"
ValidChars
="+-=/*()."/>
四:不允许输入数字
<asp:TextBoxID="TextBox4"runat="server"/>
<ajaxToolkit:FilteredTextBoxExtender
ID="FilteredTextBoxExtender4"
runat
="server"
TargetControlID
="TextBox4"
FilterType
="Custom"
FilterMode
="InvalidChars"
InvalidChars
="1234567890"/>
属性
说明
TargetControlID
需要过滤的控件的ID
FilterType
过滤的格式:有Numbers, LowercaseLetters, UppercaseLetters, and Custom四种格式
FilterMode
过滤模式:有ValidChars (默认) or InvalidChars两种。
ValidChars
合法的字符。当设置该值时,需要FilterType包含有Custom
InvalidChars
不合法的字符:当设置该值时,需要FilterType必须是Custom
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics