精华区 [关闭][返回]

当前位置:月光软件>>讨论区精华>>〖软件开发〗>>● ASP>>★ASP的延伸★>>ASP.NET>>ASP+ 语法介绍>>asp+语法介绍(四)----asp+的服务器端编程

主题:asp+语法介绍(四)----asp+的服务器端编程
发信人: dongbao()
整理人: dongbao(2001-05-26 23:46:13), 站内信件
/*
文章出处:http://www.aspCool.com 转载请注明,谢谢!
*/
操作服务器控件的事件
每一个asp+的服务器控件都有自己的属性,方法和事件。asp+的开发者现在可以
清楚的修改和交互自己的页面
下面的这个例子,我们用到了两个服务器控件<asp:button runat=server> ,<as
p:label runat=server> 
和button 的 click 事件
<html>
   <head>
      <link rel="stylesheet"href="intro.css">
   </head>

   <script language="VB" runat=server>

       Sub SubmitBtn_Click(Sender As Object, E As EventArgs)
           Message.Text = "Hi " & Name.Text & ", you selected: " & Cat
egory.SelectedItem.Text
       End Sub

   </script>

   <body>

       <center>

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

           <asp:adrotator AdvertisementFile="ads.xml" BorderColor="bla
ck" BorderWidth=1 runat="server"/>

           <h3> Name: <asp:textbox id="Name" runat="server"/>

           Category:  <asp:dropdownlist id="Category" runat=server>
                         <asp:listitem>psychology</asp:listitem>
                         <asp:listitem>business</asp:listitem>
                         <asp:listitem>popular_comp</asp:listitem>
                      </asp:dropdownlist>

           <asp:button type=submit text="Lookup" OnClick="SubmitBtn_Cl
ick" runat="server"/>

           <p>

           <asp:label id="Message" runat="server"/>

       </form>

       </center>

   </body>
</html>

这个程序的演示地址是
  http://tutorial.superexpert.com/quickstart/aspplus/samples/webforms/
intro/intro6.aspx
这个简单的例子,我们以前在例子3中也已经简单的演示过,但是我们现在用了一
种简单和给为清晰的方法来演示新版本的服务器控件的功能

--
ICQ:43395237 OICQ:126132  
我自豪我用正版,我骄傲我用盗版!!! 

※ 来源:.月光程序代码网 http://www.moon-soft.com.[FROM: 202.108.2.11]

[关闭][返回]






转载请注明:转载自 月光程序代码网 [ http://www.moon-soft.com ]