请问如何读取radiobutton得值并插入到数据库里阿

解决方案 »

  1.   

    如果只是一个radiobutton  一般只用来判断选中与否.
      

  2.   

    radiobutton是没有selecteValue属性的.
      

  3.   

    用 `RadioButtonList
    你用RadioButton取值要写好多IF文件而用RadioButtonList只要写个
    RadioButtonList.selectItem.value就可以得到值了`
      

  4.   

    string sValue = radiobutton.checked?"1":"0";把这个变量值写进数据库就好了.
      

  5.   

    RadioButtonList.selectItem.value就可以得到值了`
    请问这个value值在哪里设定
      

  6.   


    //改变页面时,将该页分数字段的选择值写入数据库
    protected void GridView2_PageIndexChanging(object sender, GridViewPageEventArgs e)
        {
              //从行中找到RadioButtoList控件,循环取出其值     
            foreach (GridViewRow gvr in GridView2.Rows)
            {
                string score = ((RadioButtonList)gvr.FindControl("RadioButtonList1")).SelectedValue.ToString();
                 decimal score1 = Convert.ToDecimal(score);
                 //取每条记录的关键字
                 string dk=GridView2.DataKeys[gvr.RowIndex].Value.ToString();
                 //构造更新语名,更新分数
    SqlDataSourcedj.UpdateCommand = "UPDATE [PJTest] SET [score] ="+ score1+" WHERE [ID] ="+dk;
                SqlDataSourcedj.Update();        }
          
        }
      

  7.   

    RadioButtonList.selectItem.value就可以得到值了`
    请问这个value值在哪里设定
    出错了`对不起`应该是
    RadioButtonList.SelectedItem.Text