首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > asp.net >

关于repeater中绑定onclick事件传参有关问题~

2012-04-26 
关于repeater中绑定onclick事件传参问题~~~~~~asp:CheckBox IDCheckBox1 runatserver value全选

关于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 CheckBoxif(ckb!=null){ckb.attribute.add("onclick","javascript:"+ckb.id+","+(repeater.item.count+1)+";")} 

热点排行