欢迎光临
我们一直在努力

RadioButtonList在Datagrid模板列中的应用-ASP教程,数据库相关

建站超值云服务器,限时71元/月

1.radiobuttonlist插入datagrid模板列的方法与其他控件插入的方法一致。

2.从数据库中读取radiobuttonlist状态的方法

1) .aspx文件

<asp:radiobuttonlist …. selectedindex=<%# container.dataitem(”strrbl”) %>>

2) .vb文件

objdataset.tables(0).columns.add(“strrbl“)

objdataset.tables(0).rows(x).item(“strrbl“)=n

3.radiobuttonlist状态改变后读取的方法

1).aspx文件

<asp:radiobuttonlist…. autopostback=“true“ onselectedindexchanged=“rbl_selectedindexchanged“

2).vb文件

public sub rbl_wa_selectedindexchanged(byval sender as object, byval e as system.eventargs)

dim srcrbl as radiobuttonlist = ctype(sender, radiobuttonlist)

dim srccell as tablecell = ctype(srcrbl.parent, tablecell)

dim srcrow as tablerow = ctype(srccell.parent, tablerow)

end sub

srcrbl即为状态改变的radiobuttonlist,可用selectedindex/selectedvalue获取相应值

srcrow即位状态改变的radiobuttonlist所在的datagrid行,可用srcrow.cells(n).text获取相应的主键值将radiobuttonlist状态写入数据库

赞(0)
版权申明:本站文章部分自网络,如有侵权,请联系:west999com@outlook.com 特别注意:本站所有转载文章言论不代表本站观点! 本站所提供的图片等素材,版权归原作者所有,如需使用,请与原作者联系。未经允许不得转载:IDC资讯中心 » RadioButtonList在Datagrid模板列中的应用-ASP教程,数据库相关
分享到: 更多 (0)

相关推荐

  • 暂无文章