c# - How to find out first character index in my Textbox -
I have a textbox, I just need to enter the alphabet at the beginning of the text box; There is no integer, no special character ... What should I do?
If you are doing this customer, you can ASP: regular expression validator
Can be used in the following ways.
& lt; ASP: Text Box ID = "Input Box" Runat = "Server" /> & Lt; Br / & gt; & Lt; ASP: Regular Expression Validator runat = "server" controlToValidate = "inputbox" Validation Expression = "^ [A-JA-Z]. *" Error message "input should start with a letter" />
On the server side, you can only check the first letter using
bool isValid = char.IsLetter (input box text [0]);
Comments
Post a Comment