菜单切换
FACESOHO知行者
心灵
记录
远方
源代码:
保存
点击运行
<script runat="server"> Sub submit(sender As Object, e As EventArgs) label1.Text="You selected " & radiolist1.SelectedItem.Text End Sub </script>
<!DOCTYPE html> <html> <body> <form runat="server"> <asp:RadioButtonList id="radiolist1" runat="server"> <asp:ListItem selected="true">Item 1</asp:ListItem> <asp:ListItem>Item 2</asp:ListItem> <asp:ListItem>Item 3</asp:ListItem> <asp:ListItem>Item 4</asp:ListItem> </asp:RadioButtonList> <br> <asp:Button text="Submit" OnClick="submit" runat="server"/> <p><asp:Label id="Label1" runat="server"/></p> </form> </body> </html>
运行结果
Item 1
Item 2
Item 3
Item 4