asp-classic - <% %> 和 &lt;script language ="vbscript"runat ="server"> 在经典asp中有什么区别?

标签 asp-classic vbscript runatserver

我在网上找不到太多文档

到目前为止,明显的区别似乎是您不能使用“脚本”标签混合 html 和 vbscript

例如,这没关系

<% public sub display_literal() %>
文字
<% 结束子 %>

但是你应该使用脚本标签

<脚本语言="vbscript"runat="服务器">
公共(public)子 display_literal2()
response.write "literal2
"
结束子


在本页面

http://www.newobjects.com/pages/ndl/alp/asp-structure.htm

它说

In classic ASP the script written in the default script language for the page (i.e. the language assumed for the <% %> tags) is executed second - e.g. all the script code in <% %> tags is initialized after all the <SCRIPT RUNAT=SERVER ...> scripts.



但我做了几个测试并无法验证它......

我问是因为我有一个脚本(我现在手头没有)使用 <% %> 给了我一个错误,将其更改为