N
Nathan Sokalski
I have a validator control that I wrote by inheriting from the BaseValidator
class. One of the properties of my class is the id of another control which
will determine whether or not the ControlToValidate needs validated (this
property is named conditionid). When I attempt to access this control, I use
the following statement:
needsvalidated = CType(Me.Page.FindControl(Me.conditionid),
CheckBox).Checked
However, when I submit the form, I recieve the following error, which points
to the line in my code mentioned above:
Object reference not set to an instance of an object.
I know that the value for Me.conditionid is there, because I checked it
while debugging. I believe the control with that id is available, because it
is added declaratively in the *.aspx file. What could be the problem? (I
don't know if it makes a difference for this problem, but I would like to
note also that I am using a Master page, but none of the stuff I have
mentioned is in the Master page; the line of code I mentioned above is from
the validator that inherits BaseValidator, and the control that has the id
Me.conditionid is in the *.aspx page) Any help would be appreciated. Thanks.
class. One of the properties of my class is the id of another control which
will determine whether or not the ControlToValidate needs validated (this
property is named conditionid). When I attempt to access this control, I use
the following statement:
needsvalidated = CType(Me.Page.FindControl(Me.conditionid),
CheckBox).Checked
However, when I submit the form, I recieve the following error, which points
to the line in my code mentioned above:
Object reference not set to an instance of an object.
I know that the value for Me.conditionid is there, because I checked it
while debugging. I believe the control with that id is available, because it
is added declaratively in the *.aspx file. What could be the problem? (I
don't know if it makes a difference for this problem, but I would like to
note also that I am using a Master page, but none of the stuff I have
mentioned is in the Master page; the line of code I mentioned above is from
the validator that inherits BaseValidator, and the control that has the id
Me.conditionid is in the *.aspx page) Any help would be appreciated. Thanks.