I am trying to enable or disable a checkbox control based on a label control's value. I am currently using the page prerender method to work in. I have also tried in the pageload without complete success. I am simply trying to enable the checkbox only when there is a value in the label. If the label is empty (null in the DB) I want the checkbox to be disabled. Is there an easier way to do this? Am I approachin this in the right way?
I have attached my code below....
If CType(fvTest.FindControl("lbl1"), Label) is nothing Then
CType(fvCertificate.FindControl("ckbox1"), CheckBox).Enabled = False
CType(fvTest.FindControl("ckbox1"), CheckBox).Enabled = True