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

怎样给RadioButtonList的每个项添加js的onclick事件
感觉使用控件的时候用js很麻烦

------解决方案--------------------
在一个项上添加好后 然后把 <RadioButtonList> </RadioButtonList>
全部复制去皮肤文件 去掉id,text等信息
------解决方案--------------------
用foreach遍历每个item就行.加上Attribute
------解决方案--------------------
foreach (ListItem li in l.Items)
{
li.Attributes[ "onclick "] = "alert( 'sss ') ";
}
------解决方案--------------------
<asp:TextBox runat= "server " BorderStyle= "Groove " Font-Size= "9pt " ForeColor= "#404040 " onfocus= "this.style.backgroundColor= '#f5fcfe '; " onblur= "this.style.backgroundColor= 'SeaShell '; "> </asp:TextBox>

上边是我textbox的例子 放在皮肤文件里边 然后页面用这个皮肤文件
或者可以改为全局都用这个