简单教程
提交运行
代码编辑器:
<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> <meta charset="utf-8" /> <form runat="server"> <asp:RadioButtonList id="rb" runat="server" AutoPostBack="True" onSelectedIndexChanged="navigate" /> </form>
运行结果: