Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Controls > dynamically adding validators

Thread Tools

dynamically adding validators

Posts: n/a
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

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?


Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Inserting Controls Dynamically - with Validators Also Added Dynamically Jeffrey Todd ASP .Net 1 06-02-2005 04:33 PM
Regular Expression validators NOT working, Required Field validators ARE working Ratman ASP .Net 0 09-14-2004 09:36 PM
Dynamically created validators - server side validation not working. Tony ASP .Net 1 12-12-2003 11:58 AM
Dynamically generating control validators -=Chris=- ASP .Net 2 11-09-2003 06:30 AM
dynamically add controls and validators - always false Christian H ASP .Net 2 07-23-2003 09:07 AM