C# textbox char only??

Discussion in 'Software' started by sheepondrugs, May 3, 2007.

  1. sheepondrugs

    sheepondrugs Private First Class

    is there a really simple way of denying creation of a file/account if it contains anything other than a character/letter (no symbols or numbers)


    for example:-


    IF login.textbox is all characters
    Create New Account

    ELSE

    display message " Invalid name, please try again (a-z only) "



    i looked on google and people's code is really messy and untidy, (couldn't understand it)

    can anyone help me code this tiny bit of verification?


    thanks a bunch!

    'Chris
     
  2. Kodo

    Kodo SNATCHSQUATCH

    for real?

    here. drop this in a webform.. just to test.
    Code:
      <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
            <asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" ControlToValidate="TextBox1"
                ErrorMessage="RegularExpressionValidator" ValidationExpression="[a-zA-Z]+">*</asp:RegularExpressionValidator>
            <br />
            <asp:Button ID="Button1" runat="server" Text="Button" />
     

MajorGeeks.Com Menu

Downloads All In One Tweaks \ Android \ Anti-Malware \ Anti-Virus \ Appearance \ Backup \ Browsers \ CD\DVD\Blu-Ray \ Covert Ops \ Drive Utilities \ Drivers \ Graphics \ Internet Tools \ Multimedia \ Networking \ Office Tools \ PC Games \ System Tools \ Mac/Apple/Ipad Downloads

Other News: Top Downloads \ News (Tech) \ Off Base (Other Websites News) \ Way Off Base (Offbeat Stories and Pics)

Social: Facebook \ YouTube \ Twitter \ Tumblr \ Pintrest \ RSS Feeds