RadioButtonList

今天用了一下asp:RadioButtonList,发现对里面那些List增加客户端脚本是不行的。
上M$的网站看了看,说确实不行,需要用<input runat=server>代替。晕啊~

最后代码如下:

<INPUT id="rad1" onclick="Myfunction();" type="radio" CHECKED=true
     name="group1" runat="server">
    <LABEL id="lb1" runat="server">收件组</LABEL>

然后在PageLoad中写:
    lb1.Attributes.Add("for",rad1.ClientID);
才会有RadioButtonList的效果。

原文地址:https://www.cnblogs.com/huqingyu/p/22955.html