RadMaskedTextBox allow alphanumeric

4 posts, 0 answers
  1. David
    David avatar
    16 posts
    Member since:
    Jan 2012

    Posted 09 Feb 2012 Link to this post

    I just began using the ASP.NET for AJAX RadControls a few weeks ago.  I'm in the process of migrating my AJAX Control Toolkit maskededit control over to the RadMaskedTextBox and have a question regarding the mask.

    I want the user to be able to enter a value that is three-characters in length.  It can be all letters (uppercase only), all numbers, or a combination (i.e. alphanumeric).  No symbols and no spaces are allowed and if a value is entered, all three must be entered.  In the AJAX Control Toolkit, I was using a TextBox with a MaskedEditExtender...and a Mask of "???"...and this seemed to work fine.  Without having to use regular expressions or jQuery...is there a mask or some way to do this via the code-behind?

  2. Kevin
    Kevin avatar
    360 posts
    Member since:
    Jul 2012

    Posted 13 Feb 2012 Link to this post

    Hello David,

    The equivalent of the ??? is aaa.

    Mask Documentation: http://www.telerik.com/help/aspnet-ajax/input-maskedtextbox-masks.html

    I hope that helps.
  3. Andy
    Andy avatar
    2 posts
    Member since:
    Jan 2013

    Posted 03 Apr 2013 Link to this post

    In a similar vein - I'm Struggling on Masking - Who'd have thought regular expressions could be beaten eh?!

    I would like ANY amount of lowercase alpha or numeric or hyphens -

    But No spaces, full stops, underscores, special characters, etc, etc....

    Is that possible? Many thanks in advance!

    New B.
  4. Maria Ilieva
    Maria Ilieva avatar
    4017 posts

    Posted 08 Apr 2013 Link to this post

    Hello Andy,

    This scenario could be handed y using RegularExpressionValidator along with the RadMaskedTextBox as shown in the demo below:

    Kind regards,
    Maria Ilieva
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Back to Top