In a VB.net app, I have several checkboxes created with regular ASP controls, i.e. `<asp:CheckBox ID="cb3" runat="server" Checked="true" />`

I'm trying to implement a "Select all/none" functionality but I'm having a few problems. The Javascript is not changing the state of the checkboxes in Internet Explorer (v9). I tried debugging with IE's dev tools and the checkboxes are definitely getting their `checked` property set to `true`. (Also tried setting to "checked".) Here is the JS:

```
function setCheckboxes( state )
{
    var inputs = document.getElementsByTagName("input");
    for ( var i in inputs )
    {
        if ( inputs[i].type == "checkbox" )
        {
            // this line is definitely executed on the checkboxes
            inputs[i].checked = state;
            // this doesn't work either
            //inputs[i].checked = (state ? "checked" : "");
        }
    }
}

document.getElementById("cbSelectAll").onclick = function() {
    setCheckboxes(true);
    return false;
}

document.getElementById("cbSelectNone").onclick = function() {
    setCheckboxes(false);
    return false;
}

```

A second problem, that may be related, occurs in Firefox (v11). The above JS works fine and deselects checkboxes, however upon submission they are set to their initial state. Selecting and deselecting by clicking works fine as normal though. How do I fix this?

Edit: to make clear, this is **specifically a problem with .net, not just basic HTML**. I tried a basic page with checkboxes and IE (de)selects them just fine.

UPDATE 2: including more information since it may be relevant. I just checked a few things and *clicking* the checkboxes does not appear to change their state in Internet Explorer, but when submitting their state has been stored.

I'm using a Telerik Grid view and binding data to it. Here's the aspx code:

```
    <telerik:RadGrid ID="gridContacts" runat="server" Skin="Office2007" GridLines="None" AutoGenerateColumns="False">
        <MasterTableView>
            <RowIndicatorColumn>
                <HeaderStyle Width="20px" />
            </RowIndicatorColumn>
            <ExpandCollapseColumn>
                <HeaderStyle Width="20px" />
            </ExpandCollapseColumn>
            <Columns>
                <telerik:GridBoundColumn DataField="id" DataType="System.String" UniqueName="id" Visible="False">
                    </telerik:GridBoundColumn>
                <telerik:GridBoundColumn DataField="name" DataType="System.String" UniqueName="name" HeaderText="Name">
                    </telerik:GridBoundColumn>
                <telerik:GridBoundColumn DataField="email" DataType="System.String" UniqueName="email" Visible="False">
                    </telerik:GridBoundColumn>
                <telerik:GridBoundColumn DataField="sms" DataType="System.String" UniqueName="sms" Visible="False">
                    </telerik:GridBoundColumn>
                <telerik:GridTemplateColumn DataField="useemail" DataType="System.Boolean" UniqueName="useemail" HeaderText="Email"> 
                    <ItemTemplate> 
                        <asp:CheckBox ID="cbEmail" runat="server" Checked='<%# Eval("useemail") %>' /> 
                    </ItemTemplate> 
                </telerik:GridTemplateColumn> 
                <telerik:GridTemplateColumn DataField="usesms" DataType="System.Boolean" UniqueName="usesms" HeaderText="SMS"> 
                    <ItemTemplate> 
                        <asp:CheckBox ID="cbSMS" runat="server" Checked='<%# Eval("usesms") %>' /> 
                    </ItemTemplate> 
                </telerik:GridTemplateColumn>
            </Columns>
        </MasterTableView>
        <FilterMenu EnableTheming="True" Skin="Office2007">
            <CollapseAnimation Duration="200" Type="OutQuint" />
        </FilterMenu>
    </telerik:RadGrid>

```

For each checkbox, the HTML that comes out is this:

```
<input name="ctl00$ContentPlaceHolder1$gridContacts$ctl00$ctl04$cbEmail"
class="Office2007 input" id="ctl00_ContentPlaceHolder1_gridContacts_ctl00_ctl04_cbEmail"
type="checkbox" CHECKED="checked" /><label class="Office2007 radfdCheckboxChecked"
for="ctl00_ContentPlaceHolder1_gridContacts_ctl00_ctl04_cbEmail" unselectable="on">&nbsp;</label>

```