2012年11月2日 星期五

RadioButton 使用javascript 在Gridview 中單選





//GridView OnRowDataBound
protected void grid_view_RowDataBound(object sender, GridViewRowEventArgs e)
        {
            if (e.Row.RowType == DataControlRowType.DataRow)
            {
                RadioButton rb = (RadioButton)e.Row.FindControl("RadioButton1");
                rb.Attributes.Add("onclick", "judge(this)");//給RadioButton加onclick屬性
            }
        }

沒有留言:

張貼留言