如何改变RadioButtonList的属性
我想实现功能是这样的,我一点一个按钮的时候把RadioButtonList变成为选中状态。就是把他初始化 问题点数:100、回复次数:7Top
1 楼luck0235(风平浪静时人人都能掌舵)回复于 2006-10-01 22:16:56 得分 0
upTop
2 楼kennie236288(每天前进一小步)回复于 2006-10-01 22:59:39 得分 0
学习Top
3 楼lzmboy10()回复于 2006-10-01 23:11:53 得分 0
不是把。难道不可能???Top
4 楼qiaoxinwei(小新)回复于 2006-10-01 23:17:40 得分 0
是不是这个意思:
<asp:RadioButtonList id="RadioButtonList1" runat="server">
<asp:ListItem>项 1</asp:ListItem>
<asp:ListItem>项 2</asp:ListItem>
<asp:ListItem>项 3</asp:ListItem>
<asp:ListItem>项 4</asp:ListItem>
<asp:ListItem>项 5</asp:ListItem>
<asp:ListItem>项 6</asp:ListItem>
</asp:RadioButtonList>
<asp:Button id="Button1" Text="选中" onclick="Button1_Click" runat="server"/>
后台
void Button1_Click(object Source, EventArgs e) {
if (RadioButtonList1.SelectedIndex > -1) {
Label1.Text = "您选择了:" + RadioButtonList1.SelectedItem.Text;
}
}
Top
5 楼lzmboy10()回复于 2006-10-01 23:28:47 得分 0
不是这个意思。就是如果我点了按钮就让RadioButtonList1.处于为选中状态Top
6 楼sp1234(asp.net不是一个语言,是一个操作系统)回复于 2006-10-02 00:57:04 得分 0
SelectedIndex,SelectedValue 都可以写入值。Top
7 楼hy_lihuan(我想早恋,可是已经晚了)回复于 2006-10-02 01:07:32 得分 0
SelectedIndex可以选中你要的那个选项,SelectedValue 匹配你写入值的那个选项Top




