J
jsh02_nova
I'm adding validators dynamically to a page with the following code:
MyVal = New RegularExpressionValidator
With MyVal
.ControlToValidate = tbAttrValue.Id
.ValidationExpression = "(\w){1,2}"
.ErrorMessage = "Warning W.R."
.Display = ValidatorDisplay.Dynamic
End With
Me.Page.Validators.Add(MyVal)
The project compiles and runs however, when I submit the page I get an
'Object reference not set to an instance of an object.' exception. Has
anybody else run across this problem, if so what am I missing?
thx
MyVal = New RegularExpressionValidator
With MyVal
.ControlToValidate = tbAttrValue.Id
.ValidationExpression = "(\w){1,2}"
.ErrorMessage = "Warning W.R."
.Display = ValidatorDisplay.Dynamic
End With
Me.Page.Validators.Add(MyVal)
The project compiles and runs however, when I submit the page I get an
'Object reference not set to an instance of an object.' exception. Has
anybody else run across this problem, if so what am I missing?
thx