To answer your question: Yes, you can, and here is how:
Your ID is how you use the object in the codebehind. So something like
if activate = false then
... ' Do something
end if
BUT! I am finding this to be an issue with all new coders, and I curse Microsoft for starting this trend, but when coding you should use some Hungarian Notation (or some variation of it) inorder to make you code both logical and readable.
What I mean is this:
Your checkboxes should be named like this: chkActivate & chkDelete respectively. The chk prefix differentiates what you are referring to in your code, and indicates CHECKBOX.
Same as when creating variables:
Dim intValue as Integer ' int prefix indicates you are using an Integer value.
Dim strValue as String ' str prefix indicates you are using a string value
Just some thoughs....
Hope this helped. Happy coding :cool:
i have a simple access DB that contains the table new_members. what i want to do is fill a table with the data from new_members and then choose whether to activate or delete them. what i have done already is used asp:repeater to build the dynamic table and of course it works perfectly, the table looks great. however, all of this is in a form because i want to access the checkboxes for activate/delete. here is an example of my repeater code to give you an idea of what im dealing with:
<ItemTemplate> <table border="0" width="90%"> <tr> <td width="26%"> <#Container.DataItem("first_name")%> </td> <td width="26%"> <%#Container.DataItem("last_name")%> </td> <td width="26%"> <%#Container.DataItem("email")%> </td> <td width="5%" align="center"> <asp:CheckBox Runat ="server" ID="activate"></asp:CheckBox> </td> <td width="5%" align="center"> <asp:CheckBox Runat ="server" ID="delete"></asp:CheckBox> </td> </tr> </table> </ItemTemplate>now i want to access those checkboxes in the codebehind, but i dont know how? is there a better way to do this? im thinking yes ;)