Franz:
If that's ur code, it doesn't work like that. You don't simply assign the
controlToValidate and the isValid will be set accordingly. During the
RaisePostBackEvent, the page calls Validate() on the control which forces
the validation.
You might try modifyning your code to do:
Dim y As RegularExpressionValidator = New RegularExpressionValidator
y.ValidationExpression =
"^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$"
y.ControlToValidate = "ss5ssss"
y.Validate()
Dim gg As Boolean = y.IsValid
But I'm not sure if it'll work because it'll never render. To be honest, if
you aren't rendering a control, why not just use a System.Text.Regex ??
Karl
--
MY ASP.Net tutorials
http://www.openmymind.net/ - New and Improved (yes, the popup is annoying)
http://www.openmymind.net/faq.aspx - unofficial newsgroup FAQ (more to
come!)
"franz" <ma****@libero.it> wrote in message
news:11**********************@g43g2000cwa.googlegr oups.com...
does anybody tell me why it doesn't works?? in any case gg beame true
thanks
franz
Dim y As RegularExpressionValidator = New RegularExpressionValidator
y.ValidationExpression =
"^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$"
y.ControlToValidate = "ss5ssss"
Dim gg As Boolean = y.IsValid