RadiobuttonList

asp.net html 控件 radiobuttonlist

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