Can anyone help me with adding a JavaScript function to my checkbox within a datalist, where the ID of the control is passed as a parameter?
I would like to achieve this on an ASP page without using the OnItemDataBound method. I have tried the following code but it's not working. Any suggestions?
<asp:CheckBox ID='chkDatabase' runat="server" CssClass="NormalBold" Text='<%# Eval("Name") %>' onclick='javascript:showme("<%# Eval("ID") %>")' ></asp:CheckBox>
This is part of the datalist code:
<asp:DataList runat="server" ID="ddlDatabases" CssClass="ddlDatabases" CellSpacing="0" CellPadding="0" RepeatLayout="Table" OnItemDataBound="ddlcount_ItemDataBound">
<ItemTemplate>
<div style=" float: left; width:150px;padding:20px; " >
<asp:CheckBox ID='chkDatabase' runat="server" CssClass="NormalBold" Text='<%# Eval("Name") %>' onclick='javascript:showme("<%# Eval("ID") %>")' >
</asp:CheckBox>
</div>
</ItemTemplate>
</asp:DataList>
Thank you in advance for any assistance!