数据绑定控件单选框

应某人要求,简单写一下
这里用DataList举个例子:
如html代码如下:
 

1   < asp:DataList  ID ="dlstClubTheme"  runat ="server"  RepeatColumns ="2"  RepeatLayout ="table" >
2                                                      < ItemTemplate >
3                                                          < asp:Label  ID ="lbLogoPath"  runat ="server"  Style ="display: none;"  Text ='<%#  Eval("LogoPath") % > '> </ asp:Label >
4                                                          < span  style ="padding: 5px;" >
5                                                              < img  src ="<%# Eval(" Thumbnail") % > " width="320" height="63" alt=" <% Eval("Description" %> " /> </ span >< br  />
6                                                          < input  id ="rbtnClubTheme"  type ="radio"  name ="rbtnClubTheme"  value ='<%#  Eval("LogoPath") % > ' />
7                                                          <% Eval("Name" %>
8                                                      </ ItemTemplate >
9                                                  </ asp:DataList >
单选框是rbtnClubTheme这个,关键点在于,把你想操作的东西,绑定到value去
后台取值操作如下:
  string  LogoPath  =  Request[ " rbtnClubTheme " ];

打完..收工...

转载于:https://my.oschina.net/secyaher/blog/274160

猜你喜欢

转载自blog.csdn.net/weixin_33675507/article/details/91967074