我有两个radio buttons
和两个panels
在我的网页上,我想show
面板1当单选按钮1选中更改并隐藏面板2和类似的面板2需要显示当单选按钮2选中更改并隐藏PANEL1。使用单选按钮显示和隐藏面板
这是我怎么没有成功完成
这里是我的单选按钮:
<asp:RadioButton ID="RadioButton1" runat="server" Text="Text" ForeColor="White" GroupName="selection" OnCheckedChanged="RadioButton1_CheckedChanged"/>
<asp:RadioButton ID="RadioButton2" runat="server" Text="Image" ForeColor="White" GroupName="selection" OnCheckedChanged="RadioButton2_CheckedChanged"/>
这RadioButton1_CheckedChanged:
If RadioButton1.Checked = True Then
RadioButton2.Checked = False
Panel1.Visible = True
Panel2.Visible = False
End If
这RadioButton2_CheckedChanged:
If RadioButton2.Checked = True Then
RadioButton1.Checked = False
Panel1.Visible = False
Panel2.Visible = True
End If
需要将Autopostback设置为true才能有效工作。 – JonH 2012-02-07 16:36:32