Selecting

ninel

Active member
Joined
Mar 23, 2005
Messages
32
Location
Land O Lakes, Florida
Programming Experience
3-5
I have the following code:
VB.NET:
<table cellSpacing="1" cellPadding="1" width="100%" border="0">
                                            <TR>
                                                <td align="center" width="100%"><asp:datagrid id="grdResults" runat="server" Height="50px" Font-Names="Tahoma" Width="600px" Font-Size="XX-Small"
                                                        PageSize="1" CellPadding="1" AutoGenerateColumns="False" BorderColor="Silver" BorderStyle="Solid" CellSpacing="1" HorizontalAlign="Center"
                                                        ForeColor="Black">
                                                        <HeaderStyle Font-Bold="True"></HeaderStyle>
                                                        <Columns>
                                                            <asp:TemplateColumn>
                                                                <ItemTemplate>
                                                                    <asp:CheckBox ID ="checkAll" Runat="server" onclick="selectAll();" text="SELECT ALL" ></asp:CheckBox>
                                                                </ItemTemplate>
                                                                <ItemTemplate>
                                                                    <input type="checkbox" ID="chkSelect" runat="server"></asp:CheckBox>
                                                                </ItemTemplate>
                                                                
                                                            </asp:TemplateColumn>
                                                            <asp:TemplateColumn>
                                                                <HeaderTemplate>
                                                                    ID
                                                                </HeaderTemplate>
                                                                <ItemTemplate>
                                                                    <asp:Label ID="lblDetailId" text='<%# DataBinder.eval (Container.dataitem, "itmPunchtimeId")%>' Runat="server">
                                                                    </asp:Label>
                                                                </ItemTemplate>
                                                            </asp:TemplateColumn>
                                                            <asp:BoundColumn DataField="sAgentId" HeaderText="AgentId"></asp:BoundColumn>
                                                            <asp:BoundColumn DataField="sLastName" HeaderText="Last Name"></asp:BoundColumn>
                                                            <asp:BoundColumn DataField="sFirstName" HeaderText="First Name"></asp:BoundColumn>
                                                            <asp:BoundColumn DataField="sRawLogin" HeaderText="StartTime"></asp:BoundColumn>
                                                            <asp:BoundColumn DataField="sRawLogout" HeaderText="EndTime"></asp:BoundColumn>
                                                        </Columns>
                                                    </asp:datagrid></td>
                                                <TD> </TD>
                                            </TR>
                                            <tr>
                                                <td> </td>
                                            </tr>
                                        </table>

I am trying to put an onclick event in the checkbox. I see many examples on the internet, but when I do it a red sqiggly line appears under the onclick.

When I move my mouse over it I get the message "Could not find any attribute 'onclick' of element 'checkbox'"

What am I doing wrong?
Thanks,
Ninel
 
There is no OnClick event. There is a Click event or a CheckedChanged event. If you double-click the checkbox in the designer, it will set up the default event for you ( in this case, CheckedChanged )
 
Sorry, I did not see you were working with ASP.NET. Disregard what I have said :eek: . I have very little ASP.NET knowledge
 
Back
Top