当前位置: 代码迷 >> ASP.NET >> 如何为CheckBoxList里面的每个CheckBox添加客户端事件onclick
  详细解决方案

如何为CheckBoxList里面的每个CheckBox添加客户端事件onclick

热度:4367   发布时间:2013-02-25 00:00:00.0
怎么为CheckBoxList里面的每个CheckBox添加客户端事件onclick
怎么为CheckBoxList里面的每个CheckBox添加客户端事件onclick

------解决方案--------------------------------------------------------
asp.net 2.0可以直接遍历Item添加,以前的版本添加不了,请换用 <input type=checkbox
------解决方案--------------------------------------------------------
类似于这样的属性添加
this.fuSignature.Attributes.Add( "onpropertychange ", imgSignature.ClientID + ".src= 'file:/// ' " + "+this.value ");
------解决方案--------------------------------------------------------
foreach(ListItem item in this.cblCity.Items)
{
item.Attributes[ "onclick "] = "check(this) ";
}

------解决方案--------------------------------------------------------
foreach(ListItem item in this.cblCity.Items)
{
item.Attributes[ "onclick "] = "check(this) ";
}
这样不行。
在这个item.Attributes只有get,没有set所以设置无效。
怎么可能。你试过再说吧。
------解决方案--------------------------------------------------------
item.Attributes.Add( "onclick ", "check(this) ");
  相关解决方案