关于repeater中绑定onclick事件传参问题~~~~~~
<asp:CheckBox ID="CheckBox1" runat="server" value="全选" onclick="SelectChkAll(this.id,<%#Repeater1.Items.Count+1%>)" />
这样写解析为
<input id="Repeater1_ctl00_CheckBox1" type="checkbox" name="Repeater1$ctl00$CheckBox1" onclick="SelectChkAll(this.id,<%#Repeater1.Items.Count+1%>);" />
谁遇到或者怎么解决的告诉下~~~~~
------解决方案--------------------在后台注册js事件就不会乱码了
------解决方案--------------------
C# code
CheckBox ckb=repeater.findcontrol('CheckBox1') as CheckBox
if(ckb!=null)
{
ckb.attribute.add("onclick","javascript:"+ckb.id+","+(repeater.item.count+1)+";")
}