I'm trying to find a checkbox on my page. I store the ID of the checkbox that I want to check in the DB, with my code, the controls just show up as null, so right now I am unable to grab the control. How can I get the control to check. In my code is several attempts to grab it.
string TypeofR = p2.TypeOfRelease;
mpContentPlaceHolder = (ContentPlaceHolder)Master.FindControl("MainContent");
RadioButton tb = (RadioButton)Master.FindControl("MainContent").FindControl(TypeofR);
Control myControl1 = mpContentPlaceHolder.FindControl(TypeofR);
if (myControl1 != null)
((CheckBox)myControl1).Checked = true;