如何从RadioButtonList获取所选值?

我的页面上有一个RadioButtonList,它通过Data Binding填充

   

如何获取用户在“提交”方法中选择的单选按钮的值?

ASPX代码看起来像这样:

         

而背后的代码:

 protected void Button1_Click(object sender, EventArgs e) { string selectedValue = rblist1.SelectedValue; Response.Write(selectedValue); } 

使用单选按钮的ID,尝试rb.SelectedValue

 string radioListValue = RadioButtonList.Text; 

radiobuttonlist.selected 用你的代码处理。