页面上是个RadioButtonList以下代码放到Page_Load里面。想给RadioButtonList项的点击加上脚本的。rdlFormat.Items[0].Attributes.Add("onclick", "witchtype('TypePic')") ;
rdlFormat.Items[1].Attributes.Add("onclick", "switchtype('TypeWord')") ;

解决方案 »

  1.   

    rdlFormat.Attributes.Add("onclick","changetype()");
    <script language="javascript">
       function changetype()
       {
          if (rdlFormat_0.checked)
           {
              witchtype('TypePic');
           }
                             if (rdlFormat_1.checked)        
           {
             switchtype('TypeWord');
           }
       }
      

  2.   

    page load事件感觉不妥,那时候RadioButtonList还没有数据邦定吧。找个数据邦定后的事件看看
      

  3.   

    居然是把代码追加到table上了的。不过还通过。不用绑定自己定义了collection的。