2007-06-23

学习ASP中子程序的应用

来源: 本站论坛 作者:佚名 评论 0 条
 

在ASP中,你可通过VBScript和其他方式调用自程序。
实例:

调用使用VBScript的子程序
如何从ASP调用以VBScript编写的子程序。
<html>

<head>
<%
sub vbproc(num1,num2)
response.write(num1*num2)
end sub
%>
</head>

<body>
<p>
You can call a procedure like this:
</p>
<p>
Result: <蔿l vbproc(3,4)%>
</p>
<p>
Or, like this:
</p>
<p>
Result: <%vbproc 3,4%>
</p>
</body>

</html>
调用使用JavaScript的子程序
如何从ASP调用以JavaScript编写的子程序。

<%@ language="javascript" %>
<html>
<head>
<%
function jsproc(num1,num2)
{
Response.Write(num1*num2)
}
%>
</head>
<body>
<p>
Result: <%jsproc(3,4)%>
</p>
</body>
</html>

调用使用VBScript和JavaScript的子程序
如何在一个ASP文件中调用以VBScript和JavaScript编写的子程序。

<html>
<head>
<%
sub vbproc(num1,num2)
Response.Write(num1*num2)
end sub
%>
<script language="javascript" runat="server">
function jsproc(num1,num2)
{
Response.Write(num1*num2)
}
</script>
</head>
<body>
<p>Result: <蔿l vbproc(3,4)%></p>
<p>Result: <蔿l jsproc(3,4)%></p>
</body>
</html>


(本文仅表明作者个人观点,不代表本站及其管理员立场.) 推荐 收藏 投稿 打印 返回 关闭
上一篇:27个Asp.Net经常会用到的函数集  
下一篇:实例编程:用ASP.Net和Access编写留言本
    评论加载中…
 推荐文章
     

网站首页  -  网站地图 -   站长论坛  -  网站投稿  -    -  网站管理
Copyright © 2008 芜湖站长站 All Rights Reserved 皖ICP备07500611号