Sure, here we go:
Public Shared Function Test(ByVal campo As TextBox)
Dim rf As New RegularExpressionValidator
rf.ID = "rf"
rf.Enabled = True
rf.Visible = True
rf.Display = ValidatorDisplay.Dynamic
rf.ErrorMessage = "You must enter a value"
rf.Text = "*"
rf.ValidationExpression = "\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*"
rf.ControlToValidate = (campo.ID)
rf.EnableClientScript = True
rf.EnableViewState = False
rf.Validate = campo
End Function
but this code above, it seems to do nothing when i use it on a button (on
click event). Something is missing to this simple code work fine.
could you help me up ?
"Miha Markic" <miha at rthand com> wrote in message
news:O3**************@TK2MSFTNGP11.phx.gbl...
Can you post similar code?
--
Miha Markic - RightHand .NET consulting & software development
miha at rthand com
"Ricardo Corsi P. Cesar" <rc****@webcompany.com.br> wrote in message
news:OD**************@TK2MSFTNGP10.phx.gbl... Hi, i looking for example in asp.net (VB) to make the
RegularExpressionValidator in runtime in my code behind.
I found some similars codes, but nothing in VB..
thanks!