Wrox Home  
Search P2P Archive for: Go

  Return to Index  

aspx_beginners thread: Keep getting false for checkbox


Message #1 by "Rob Taylor" <rob@t...> on Mon, 13 May 2002 13:21:32 -0400
This is driving me nuts.  I have a checkbox in a grid.
I am looping threough to grab their checked state when the button is
clicked.
I continue to get a "False" for the boxes even though I have checked them.
Any thoughts?

Dim i as integer
Dim _item as DataGridItem
    For i = 0 to ShowMods.Items.Count-1
        _item = ShowMods.items(i)
        Dim ApprBox as CheckBox =  CTYPE(_item.FindControl("appr"),
Checkbox)
        If ApprBox.checked = true then
            response.write("yes" & " ")
        End If
    NEXT

<asp:DataGrid
id="ShowMods"
RUNAT="server"
autoGenerateColumns="false">

<COLUMNS>
<asp:TemplateColumn>
<ItemTemplate>
<asp:checkbox  runat="server"  id="appr"/>
</ItemTemplate>
</asp:TemplateColumn>
</COLUMNS>



  Return to Index