做一个RadioButtonList控件时 将AUTOPOSTBACK属性设置为true时选择之后又回到默认值了
这样做的数据绑定
RadioButtonList1.DataSource = DS.Tables[0].DefaultView;
RadioButtonList1.DataTextField="药品名称"; RadioButtonList1.DataValueField="药品名称";
RadioButtonList1.DataBind();
当选择之后准备输出到lable5中时
this.Label5.Text=RadioButtonList1.SelectedItem.Value;
显示错误 未将对象引用设置到对象的实例。
这样做的数据绑定
RadioButtonList1.DataSource = DS.Tables[0].DefaultView;
RadioButtonList1.DataTextField="药品名称"; RadioButtonList1.DataValueField="药品名称";
RadioButtonList1.DataBind();
当选择之后准备输出到lable5中时
this.Label5.Text=RadioButtonList1.SelectedItem.Value;
显示错误 未将对象引用设置到对象的实例。
解决方案 »
- OleDbType里没有Ntext,应该用什么
- 在FreeTextBox粘贴Word文档插入数据库时老是报错?
- 一个很急的问题
- 最近想学linux,请问:要学那个公司的那个版本好呢?
- datagrid在运行时自动创建列能放在手动添加列的前面吗?
- hibernate 处理原生的SQL(求解)
- 怎么在同一个页面上定位某个位置
- 关于打印.
- treeview的checkbox问题?
- 新手:关于在.NET的FORM中设置上传的语句该如何写?最好有实例
- |M| 站点下载问题:已知我的站点IP为211.147.225.XXX FTP user="myweb" pass="123456" 如何下载这个站点下的bin目录下的所有文件
- 请大家说说:把数据库中的数据读到数组中,采用哪种方式比较好?
!IsPostBack()
if(!IsPostBack)
{
bind your radiobuttonlist;
}