Hi
I have a repeater that during the page load I want to go through all checkboxes and check the ones should be checked.
I am bound to a sqldatasource control.
Here is the code. when I run the for each loop during page load it has nothing for controls.count. I also tried prerender in case the controls werent bound yet.
Any ideas why I cant get the checkboxes?
Code:<asp:Repeater runat="server" ID="univList" DataSourceID="UnivDS"> <HeaderTemplate> <a href='javascript:deselect();'>Deselect All</a> <table> </HeaderTemplate> <ItemTemplate> <tr id='univtr<%# DataBinder.Eval(Container.DataItem, "companyid")%>'> <td><input type="checkbox" runat="server" ID='univChk' onclick="javascript:toggleRow(this);" text='<%#DataBinder.Eval(Container.DataItem, "companyid")%>' /></td> <td><%# DataBinder.Eval(Container.DataItem, "companyname")%></td> </tr> </ItemTemplate> <FooterTemplate> </table> </FooterTemplate> </asp:Repeater>Code:For Each check As Control In univList.Controls If TypeOf check IS HtmlInputCheckBox AndAlso ids.Contains(CTYPE(check, HtmlInputCheckBox).Value) Then CTYPE(check, HtmlInputCheckBox).Checked = True End If Next




Reply With Quote