How To Use FilterTextBoxIn Asp.net.
SOURCE OF PAGE
Firstly Add Directory on page
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
Only Restrict For Upper case
<asp:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server">
</asp:ToolkitScriptManager>
<asp:TextBox ID="txtUpperCase" runat="server"/>
<asp:FilteredTextBoxExtender ID="UpperCase" runat="server" TargetControlID="txtUpperCase" FilterType="UppercaseLetters"> </asp:FilteredTextBoxExtender>
OutPut-
Show UpperCase Letetr In Text box.
Only Restrict For Lower case
<asp:TextBox ID="txtLowerCase" runat="server"/>
<asp:FilteredTextBoxExtender ID="LowerCase" runat="server" TargetControlID="txtLowerCase"
FilterType="LowercaseLetters"> </asp:FilteredTextBoxExtender>
OutPut-
Show LowerCase Letetr In Text box .
Only Restrict For Numeric Value
<asp:TextBox ID="txtNumbers" runat="server"/
<asp:FilteredTextBoxExtender ID="Numbers" runat="server" TargetControlID="txtNumbers" FilterType="Numbers" </asp:FilteredTextBoxExtender>
OutPut-
Show Numbers In Text box
To Restrict certain or special characters
<asp:TextBox ID="TextBox1" runat="server"/>
<asp:FilteredTextBoxExtender ID="Custome" runat="server" TargetControlID="TextBox1"
FilterMode="InvalidChars" InvalidChars="!@#$%^&*()~?><|\';:">
</asp:FilteredTextBoxExtender>
OutPut-
InvalidChar Not Enter In Text box.We Can Give Valid Character Same like As Ex.
SOURCE OF PAGE
Firstly Add Directory on page
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
Only Restrict For Upper case
<asp:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server">
</asp:ToolkitScriptManager>
<asp:TextBox ID="txtUpperCase" runat="server"/>
<asp:FilteredTextBoxExtender ID="UpperCase" runat="server" TargetControlID="txtUpperCase" FilterType="UppercaseLetters"> </asp:FilteredTextBoxExtender>
OutPut-
Show UpperCase Letetr In Text box.
Only Restrict For Lower case
<asp:TextBox ID="txtLowerCase" runat="server"/>
<asp:FilteredTextBoxExtender ID="LowerCase" runat="server" TargetControlID="txtLowerCase"
FilterType="LowercaseLetters"> </asp:FilteredTextBoxExtender>
OutPut-
Show LowerCase Letetr In Text box .
Only Restrict For Numeric Value
<asp:TextBox ID="txtNumbers" runat="server"/
<asp:FilteredTextBoxExtender ID="Numbers" runat="server" TargetControlID="txtNumbers" FilterType="Numbers" </asp:FilteredTextBoxExtender>
OutPut-
Show Numbers In Text box
To Restrict certain or special characters
<asp:TextBox ID="TextBox1" runat="server"/>
<asp:FilteredTextBoxExtender ID="Custome" runat="server" TargetControlID="TextBox1"
FilterMode="InvalidChars" InvalidChars="!@#$%^&*()~?><|\';:">
</asp:FilteredTextBoxExtender>
OutPut-
InvalidChar Not Enter In Text box.We Can Give Valid Character Same like As Ex.
0 comments :
Post a Comment