This is a migrated thread and some comments may be shown as answers.

RadMaskedTextBox allow alphanumeric

3 Answers 412 Views
Input
This is a migrated thread and some comments may be shown as answers.
David
Top achievements
Rank 1
David asked on 09 Feb 2012, 09:10 PM
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?

Thanks.

3 Answers, 1 is accepted

Sort by
0
Kevin
Top achievements
Rank 2
answered on 13 Feb 2012, 02:48 PM
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.
0
Andy
Top achievements
Rank 1
answered on 03 Apr 2013, 02:55 PM
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.
0
Maria Ilieva
Telerik team
answered on 08 Apr 2013, 01:45 PM
Hello Andy,

This scenario could be handed y using RegularExpressionValidator along with the RadMaskedTextBox as shown in the demo below:
http://demos.telerik.com/aspnet-ajax/input/examples/common/validation/defaultcs.aspx

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.
Tags
Input
Asked by
David
Top achievements
Rank 1
Answers by
Kevin
Top achievements
Rank 2
Andy
Top achievements
Rank 1
Maria Ilieva
Telerik team
Share this question
or