dimanche 1 février 2015

using Databinder.Eval in onclick of checkbox in datagrid


<asp:DataGrid ID="dg" runat="server">
<Columns>
<asp:TemplateColumn>
<ItemTemplate>
<asp:CheckBox ID="cb" runat="server" onclick='myCheckChanged("<%#DataBinder.Eval(Container, "DataItem.myid")%>")' />
</ItemTemplate>
</asp:TemplateColumn>
</Columns>
</asp:DataGrid>


This runs but when I click the checkbox in the browser I get a js error. I tried all the combinations of single and double quotes and escaping but i either get a js error or a .net "The server tag is not well formed" error. how can I do this?





Aucun commentaire:

Enregistrer un commentaire