ninel
Active member
I have the following code:
Code:
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
Code:
<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>
<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