How can I useMaskedEditExtender for textbox that should accept address of website? thanks
Asked
Active
Viewed 1,908 times
1 Answers
3
Why would you use an MaskedEdit
? I'd use a Textbox with a RegularExpressionValidator
.
MaskedEdit
is good for data that has a fixed format across your data domain. For instance the SSID is always in the format 000-00-0000
, a phone number (in U.S.) is (000) 000-0000
, the new zip code is 00000-0000
. and so forth...
Not for a wide variant of formats like an URL, which is governed by an RFC.

AlexB
- 7,302
- 12
- 56
- 74

Paulo Santos
- 11,285
- 4
- 39
- 65
-
1Just to add to Paulo's answer. Consider two domains- www.somedomain.com, and www.somedomain.co.uk. Obviously unless you were always collecting www.{domain}.com, a MaskedEdit wouldn't work well. – RichardOD Jul 05 '09 at 15:08
-
Agreed. Validating the control would be more appropriate than using a mask. I'm sure there's plenty of regular expressions on the 'Net that can validate an Internet URL. – Jacob Jul 05 '09 at 17:44