Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

CheckBoxList.RadioBoxList之类,如果初始化时某个ListItem设置为Selected=true,那么SelectedIndexChanged就会混乱。

4 views
Skip to first unread message

������

unread,
Aug 29, 2009, 7:40:44 AM8/29/09
to
CheckBoxList.RadioBoxList֮�࣬����ʼ��ʱij��ListItem����ΪSelected=true����ôSelectedIndexChanged�ͻ���ҡ�
�����������selected=true����ôSelectedIndexChanged�¼���������
����������������ˣ��벻�����⵽�׳������googleҲû�ҵ���ȷ�Ľ������������һ�����ϡ�
����ð��æ������лл������
�������£�
aspx:
<asp:RadioButtonList ID="radio_accountType" runat="server"
RepeatDirection="Horizontal"
AutoPostBack="true"
TabIndex="2" RepeatLayout="Table"
OnSelectedIndexChanged="radio_accountType_SelectedIndexChanged">
<asp:ListItem Text="���û�"
Value="1" Selected="true"></asp:ListItem>
<asp:ListItem Text="���û���"
Value="2"></asp:ListItem>
</asp:RadioButtonList>

c#:
protected void radio_accountType_SelectedIndexChanged(object sender,
EventArgs e)
{
switch (this.radio_accountType.SelectedValue)
{
case "1":
{
this.lbl_accountType.Text = "�û�";
this.combo_userGroup.Visible = true;
this.check_userList.Visible = true;
this.check_userGroupList.Visible = false;
break;
}
case "2":
{
this.lbl_accountType.Text = "�û���";
this.combo_userGroup.Visible = false;
this.check_userList.Visible = false;
this.check_userGroupList.Visible = true;
break;
}
}
}


0 new messages