案例:ASP.NET案例     状态:不可编辑再运行    进入竖版
 运行结果 
x
 
1
2
<script  runat="server">
3
Sub submit(Source As Object, e As EventArgs)
4
if r1.Checked=True then
5
   p1.InnerHtml="Your favorite color is red"
6
else
7
   if r2.Checked=True then
8
     p1.InnerHtml="Your favorite color is green"
9
   else
10
     if r3.Checked=True then
11
       p1.InnerHtml="Your favorite color is blue"
12
     end if
13
   end if
14
end if
15
End Sub
16
</script>
17
18
<html>
19
<body>
20
21
<form runat="server">
22
<p>请选择您喜欢的颜色:
23
<br />
24
<input id="r1" name="col" type="radio" runat="server">Red</input>
25
<br />
26
<input id="r2" name="col" type="radio" runat="server">Green</input>
27
<br />
28
<input id="r3" name="col" type="radio" runat="server">Blue</input>
29
<br />
30
<input type="button" value="提交" OnServerClick="submit" runat="server"/>
31
<p id="p1" runat="server" />
32
</form>
33
34
</body>
35
</html>
36