Accessing a CheckBoxField

G

Guest

I have a detailview with several fields ending with the CheckBoxField shown
below:

<asp:CheckBoxField DataField="aruExtraFields"
HeaderText="Extra Fields?"
ReadOnly="false"
SortExpression="aruExtraFields" />
</Fields>
</asp:DetailsView>

Please note the asp control is NOT part of a template.

In the code behind in the AlertRulesDetail_ItemUpdated, I am trying to
access the value of the field using the code:

Dim CheckBoxName As CheckBox
CheckBoxName =
CType(AlertRulesDetailView.FindControl("aruExtraFields"), CheckBox)

Unfortunately, the FindControl does not return anything. I have also tried
declaring the CheckBoxName field as CheckBoxField and changing the type in
the FindControl, but that doesn't work either.

Can somebody please tell me what I am doing wrong.

Thanks,
David
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,062
Latest member
OrderKetozenseACV

Latest Threads

Top