菜鸟学堂
在线运行
源代码
<HTML> <HEAD></HEAD> <FONT FACE="Verdana, Arial, Helvetica" SIZE=2> <FONT COLOR=#0000ff><script runat="server"><br>Sub Page_Load<br>if Not Page.IsPostBack then<br> dim mycountries=New ArrayList<br> mycountries.Add("Norway")<br> mycountries.Add("Sweden")<br> mycountries.Add("France")<br> mycountries.Add("Italy")<br> mycountries.TrimToSize()<br> mycountries.Sort()<br> rb.DataSource=mycountries<br> rb.DataBind()<br>end if<br>end sub<br><br>sub displayMessage(s as Object,e As EventArgs)<br>lbl1.text="Your favorite country is: " & rb.SelectedItem.Text<br>end sub<br></script></FONT><br><br><!DOCTYPE html><br><html><br><body><br><br><form runat="server"><br><asp:RadioButtonList id="rb" runat="server"<br>AutoPostBack="True" onSelectedIndexChanged="displayMessage" /><br><p><asp:label id="lbl1" runat="server" /></p><br></form><br><br></body><br></html><br> </HTML>
运行结果
在线运行
菜鸟学堂 edu.jb51.net