<html>
<title>第十四例 AdRotator和Button控件使用</title>
	<head>
	<script language="VB" runat=server>

   Sub Command_Button_Click(sender as Object,E as CommandEventArgs) 
    
       If e.CommandName = "Sort" and e.CommandArgument = "Descending"
          Message.Text="您用正确命令参数的点击该按钮"
       Else 
'如果检测错误，给出提示信息.
          Message.Text="参数检测错误！"
	End If
   End Sub
    
</script>
</head>
    <body>
<h3>	<font face="Verdana">第十四例 AdRotator和Button控件使用</font></h3>
       <center>

       <form action="ex14.aspx" method="post" runat="server">

           <asp:adrotator AdvertisementFile="ads.xml" BorderColor="black" BorderWidth=1 runat="server"/>
		<BR><P>
		<center>
           <asp:button AccessKey="Y" 
   	   Text="按Alt+Y获得焦点"
 	   CommandName="Sort"
           CommandArgument="Descending"
           OnCommand="Command_Button_Click" 
		 runat="server"/>
 	<asp:button AccessKey="X" 
   	   Text="按Alt+X获得焦点"
 	   CommandName="Sort"
           CommandArgument="Descending1"
           OnCommand="Command_Button_Click" 
		 runat="server"/>
		<BR><P>
 	<asp:Label id="Message" runat="server"/>
		</center>
       </form>

       </center>

   </body>
</html>