菜单切换
FACESOHO知行者
心灵
记录
远方
源代码:
保存
点击运行
<script runat="server"> sub Page_Load if Not Page.IsPostBack then dim navigate=New SortedList navigate.Add("RadioButtonList","control_radiobuttonlist.asp") navigate.Add("CheckBoxList","control_checkboxlist.asp") navigate.Add("DropDownList","control_dropdownlist.asp") navigate.Add("ListBox","control_listbox.asp") rb.DataSource=navigate rb.DataValueField="Value" rb.DataTextField="Key" rb.DataBind() end if end sub sub navigate(s as Object, e As EventArgs) response.redirect(rb.SelectedItem.Value) end sub </script>
<!DOCTYPE html> <html> <body> <form runat="server"> <asp:RadioButtonList id="rb" runat="server" AutoPostBack="True" onSelectedIndexChanged="navigate" /> </form> </body> </html>
运行结果
CheckBoxList
DropDownList
ListBox
RadioButtonList