Friday, August 5, 2022

How to validate only characters in Textbox ASP.NET C# (textbox only takes given characters not other characters) - textbox valid characters

  <asp:TextBox ID="txtLevel" Width="80%" CssClass="form-control" runat="server" 

                    MaxLength="6"></asp:TextBox>

                <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="txtLevel" SetFocusOnError="true" Display="None" ErrorMessage="Enter Level Name"></asp:RequiredFieldValidator>

                <cc1:ValidatorCalloutExtender ID="reqVal" runat="server" TargetControlID="RequiredFieldValidator1"></cc1:ValidatorCalloutExtender>

                 <cc1:FilteredTextBoxExtender ID="levelFilter" TargetControlID="txtLevel" runat="server" FilterMode="ValidChars" ValidChars="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ-/"></cc1:FilteredTextBoxExtender>

No comments:

Post a Comment