首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > asp.net >

初学者~RadiobottonList有关问题

2012-02-09 
菜鸟求救~~RadiobottonList问题以下是我的绑定`this.RadioButtonList1.DataSource ds.Tables[voteDetai

菜鸟求救~~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了

热点排行