教程集 www.jiaochengji.com
教程集 >  脚本编程  >  Asp  >  正文 asp 语法介绍(四)----asp 的服务器端编程进介

asp 语法介绍(四)----asp 的服务器端编程进介

发布时间:2016-10-24   编辑:jiaochengji.com
教程集为您提供asp 语法介绍(四)----asp 的服务器端编程进介等资源,欢迎您收藏本站,我们将为您提供最新的asp 语法介绍(四)----asp 的服务器端编程进介资源

操作服务器控件的事件
每一个asp 的服务器控件都有自己的属性,方法和事件。asp 的开发者现在可以清楚的修改和交互自己的页面
下面的这个例子,我们用到了两个服务器控件<asp:button runat=server> ,<asp:label runat=server>
和button 的 click 事件

<table width="620" align="center" border="0" cellpadding="1" cellspacing="1" style="background:#FB7"> <tr> <td width="464" height="27" bgcolor="#FFE7CE"> 代码如下</td> <td width="109" align="center" bgcolor="#FFE7CE" style="cursor:pointer;" onclick="doCopy('copy6869')">复制代码</td> </tr> <tr> <td height="auto" colspan="2" valign="top" bgcolor="#FFFFFF" style="padding:10px;" class="copyclass" id=copy6869><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: " & Category.SelectedItem.Text
End Sub
</script>
<body>
<center>
<form action="intro6.aspx" method="post" runat="server">
<asp:adrotator AdvertisementFile="ads.xml" BorderColor="black" 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_Click" runat="server"/>
<p>
<asp:label id="Message" runat="server"/>
</form>
</center>
</body>
</html>

这个简单的例子,我们以前在例子3中也已经简单的演示过,但是我们现在用了一种简单和给为清晰的方法来演示新版本的服务器控件的功能

您可能感兴趣的文章:
突破性的ASP 技术
有关微软新一代开发技术ASP 的介绍
ASP 3.0高级编程(十一)
人文的ASP开发基础入门之简介
ASP教程之ASP基础简介
常用的 ASP ActiveX 组件
asp简介和五大内置对象
ASP基础
ASP简介
ASP 全新接触(1)

[关闭]
~ ~