关于radiobuttonlist的问题,简单但很急
我在页面中的代码如下:
<asp:RadioButtonList id= "rblstatus " Runat= "server " RepeatLayout= "Flow " RepeatDirection= "Horizontal "> <asp:ListItem Value= "Y " Selected= "True "> 正常 </asp:ListItem> <asp:ListItem Value= "N "> 禁用 </asp:ListItem> <asp:ListItem Value= "C "> 销户 </asp:ListItem>
</asp:RadioButtonList>
我想在后台中只显示“正常”这项 listitem,另外两项为灰,不可点击操作,怎么操作呢,谢谢!
------解决方案--------------------pageload里边
rblstatus.Items[1].Attributes.Add( "disabled ", "disabled ");
rblstatus.Items[2].Attributes.Add( "disabled ", "disabled ");
Items[1].Items[2] 你自己改
------解决方案-------------------- <asp:RadioButtonList ID="RadioButtonList1" runat="server" >
<asp:ListItem Enabled="False">销户</asp:ListItem>
<asp:ListItem Enabled="False">禁用</asp:ListItem>
<asp:ListItem Selected="True">正常</asp:ListItem>
</asp:RadioButtonList>