How do I set findcontrol("cbfield") to TRUE
I just need to see the syntax for the server side page on how you set a findcontrol("checkbox field") Checked property to true! HELP...
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Shawn AustinPosted Sep 30, 2013, 5:26 PM
The only property that will come up that I can make work is .Visible. There has to be an answer to this problem. Thanks anyway.
VulpesPosted Sep 30, 2013, 4:46 PM
((CheckBox)FindControl("cbfield")).Checked = true;
or, if you're not sure whether the control exists on the page:
Control ctrl = FindControl("cbfield");
if(ctrl != null) ((CheckBox)ctrl).Checked = true;