Click here to Skip to main content
15,884,177 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
hi all,
i want to use maskedEditExtender
my Mask is like

HTML
example
Ahmedabad, GJ, 382356, india
Surat, GJ, 323232, india



C#
(city, statecode, zipcode, countryname)


city(upto 25 character)
,
space
statecode(two character)
,
space
zipcode(six character)
,
space
countryname(upto 25 character)


how can i accomplish to set masking in textbox control

please help me
thanks in advance
Posted

1 solution

Yes you can, but it is not nice. Separate various info in different boxes.

Still if you are going to do it, consider the following:

1) Mask Characters and Delimiters
9 - Only a numeric character
L - Only a letter
$ - Only a letter or a space
C - Only a custom character (case sensitive)
A - Only a letter or a custom character
N - Only a numeric or custom character
? - Any character

/ - Date separator
: - Time separator
. - Decimal separator
, - Thousand separator
\ - Escape character
{ - Initial delimiter for repetition of masks
} - Final delimiter for repetition of masks

Whit this information, you will be able to create the mask that you need and assign it to Mask property.

You can find more information here:

http://www.asp.net/ajaxLibrary/AjaxControlToolkitSampleSite/MaskedEdit/MaskedEdit.aspx[^]

Hope it helps

Cheers
 
Share this answer
 
Comments
PKriyshnA 19-Sep-12 4:26am    
but what about no of character

i mean if user enter surat,ahmedabad then it is valid

not compulsary to add all 25 characters
Mario Majčica 19-Sep-12 4:28am    
As I told you, it is a bad idea to have all this data inputed in a single box. Use multiple textboxes and perform the validation on them.
PKriyshnA 19-Sep-12 5:22am    
ok thanks
Mario Majčica 19-Sep-12 5:31am    
If the answer was useful, don't forget to accept or/and vote it. Thanks

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900