views:

490

answers:

1

How can I useMaskedEditExtender for textbox that should accept address of website? thanks

+3  A: 

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.

Paulo Santos
Just 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
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