怎么用javascript控制gridview里的RadioButton

解决方案 »

  1.   

    对 gridview  findcontrol ,找出RadioButton,
    然后,对RadioButton ,的Attribute 增加 JS就可以了。
      

  2.   

            for (int i = 0; i < gdvSystemConfig.Rows.Count; i++)
            {
                RadioButton rdo = (RadioButton)gdvSystemConfig.Rows[i].FindControl("rdo");
                rdo.Attribute.Add("onclick","testMethod()");
            }
      

  3.   

    關鍵是testMethod()這年function怎麼寫?我寫的總是有錯?謝謝
      

  4.   


    testMethod()是前面页,自己增加:<script>
      function testMethod() {
       ........
          }</script>
      

  5.   

    那就是js错误的问题了,用firefox调试一下.
      

  6.   

    testMethod()在这个方法里传一个this,例testMethod(this)