asp.Net Checkbox has NO value?
Well, for a moment, I thought I actually liked asp.net. A few minutes later, I was sadly mistaken. Back in the day, I used "**values**" in checkboxes. So if a checkbox was checked, I could get the value (i.e.: 1234) and then use it. That way, I could loop through checkboxes, and get all the values that were checked.

I used the asp:CheckBoxList, and loved it. Wow... I can do what I need in about 10 lines of code, saving to the DB and all! AMAZING... not. Then I needed to remove the label so that the text could be a link. No can do.

Then comes the DataList. Everything looks really nice. But now there's NO VALUE for my checkboxes, not to mention the extra code to find the control. I need values, otherwise, it just won't work. And of course, they were converted to input type='textbox' which could theoretically have a value, but nope. None.

    <asp:DataList
         ID='dlTest'
         OnItemDataBound='dlTest_OnItemDataBound'
         runat='server'
         RepeatColumns='2'
         DataKeyField='id'>

         <ItemTemplate>
             <asp:CheckBox ID='cbTest' runat='server' /> <%# Eval("name") %><br />
         </ItemTemplate>

    foreach (DataListItem cb in dlTest.Items) {
        CheckBox chk = (CheckBox)cb.FindControl("cbTest");
	chk.value??????????

Simple enough, right? Why doesn't the DataKeyField work, first of all? Second of all, how do I get a value in there without hacking my way through? I thought hacking your way through was overwith since asp.net replaced Classic ASP? I don't work for Microsoft, but to me, it seems it should be extremely simple. Maybe I am going at it the wrong way? I don't even see why I have to do FindControl... but that's another post/frustration.
asp.Net Checkbox has NO value?
===

Well, for a moment, I thought I actually liked asp.net. A few minutes later, I was sadly mistaken. Back in the day, I used "**values**" in checkboxes. So if a checkbox was checked, I could get the value (i.e.: 1234) and then use it. That way, I could loop through checkboxes, and get all the values that were checked.

I used the asp:CheckBoxList, and loved it. Wow... I can do what I need in about 10 lines of code, saving to the DB and all! AMAZING... not. Then I needed to remove the label so that the text could be a link. No can do.

Then comes the DataList. Everything looks really nice. But now there's NO VALUE for my checkboxes, not to mention the extra code to find the control. I need values, otherwise, it just won't work. And of course, they were converted to input type='textbox' which could theoretically have a value, but nope. None.

    <asp:DataList
         ID='dlTest'
         OnItemDataBound='dlTest_OnItemDataBound'
         runat='server'
         RepeatColumns='2'
         DataKeyField='id'>

         <ItemTemplate>
             <asp:CheckBox ID='cbTest' runat='server' /> <%# Eval("name") %><br />
         </ItemTemplate>

    foreach (DataListItem cb in dlTest.Items) {
        CheckBox chk = (CheckBox)cb.FindControl("cbTest");
	chk.value??????????

Simple enough, right? Why doesn't the DataKeyField work, first of all? Second of all, how do I get a value in there without hacking my way through? I thought hacking your way through was overwith since asp.net replaced Classic ASP? I don't work for Microsoft, but to me, it seems it should be extremely simple. Maybe I am going at it the wrong way? I don't even see why I have to do FindControl... but that's another post/frustration.