About the requiredfieldvalidator control
Posted on 2008-06-16
Hi, I have a txt box and a button in a webpart/server control. I also have a requiredfieldvalidator control. When I click the button I want to call the requiredfieldvalidators.validate() function. However, before I do this I need to set the controltovalidate property to the controlid of the textbox. This is not working. I have tried setting the id property of the textbox to "textbox" and then setting the controltovalidate property to textbox.ID. When I do this and call validate() an exception is thrown stating that the reference is not set to an instance of an object. I think I am passing in the wrong id to the controltovalidate property.
Can you help?