日期:2014-05-18  浏览次数:20400 次

关于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,&lt;%#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)+";")
}