CheckBoxList.SelectedItem.Text是怎么样获得所选的值.
tqbba 2007-11-05 04:42:38 public partial class diaocha : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
SetBind();
}
}
protected void SetBind()
{
string[] DataSorce1 = new string[] { "男20-25岁", "男26-35", "男36-45", "男46以上", "女20-25岁", "女26-35", "女36-45", "女46以上" };
CheckBoxList1.DataSource = DataSorce1;
CheckBoxList1.DataBind();
}
protected void Button1_Click(object sender, EventArgs e)
{
string CheckBoxList1Item = CheckBoxList1.SelectedItem.Text;
Response.Write(CheckBoxList1Item);
}
}
在我按了BUTTON后CheckBoxList1.SelectedItem.Text怎么会获得我选的值的???