ASP.NET HTML 控件 SortedList RadiobuttonList 2

asp.net html 控件 sortedlist radiobuttonlist 2

<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>
相关文章