顯示具有 RadioButton 標籤的文章。 顯示所有文章
顯示具有 RadioButton 標籤的文章。 顯示所有文章

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屬性
            }
        }