读书人

初学者~RadiobottonList有关问题

发布时间: 2012-02-09 18:22:27 作者: rapoo

菜鸟求救~~RadiobottonList问题
以下是我的绑定`
this.RadioButtonList1.DataSource = ds.Tables["voteDetails"];
this.RadioButtonList1.DataTextField = "voteItem";
this.RadioButtonList1.DataValueField = "voteDetailsID";
this.RadioButtonList1.DataBind();
是绑定得了``我想实现的是~~当我单击Botton1~~~
this.Label2.Text = this.RadioButtonList1.SelectedValue.ToString();
就是取不到RadioButtonList1.SelectedValue

当用普通的不是数据绑定的RadioButtonList1又得~~
为什么绑定后会不得呢?我也有this.RadioButtonList1.DataValueField = "voteDetailsID";了啊~~没写错字~~
大家帮帮我~~急``得马上结贴!

[解决办法]
是不是应该加一个条件
if(!ispostback)
{

}
//个人愚见。。。。不知道是不是
[解决办法]
page_load中加上
if(!ispostback)
{

//数据绑定
}


RadioButtonList1你要没有选择是没有值的,除非有一个checked了

读书人网 >asp.net

热点推荐