I couldn't find much documentation on the web
so far now, the obvious difference seems to be that you cant mix html and vbscript using the "script" tag
for example, this is ok
<% public sub display_literal() %>
literal
<% end sub %>
but with the script tag you should
<script language="vbscript" runat="server">
public sub display_literal2()
response.write "literal2</br>"
end sub
</script>
on this page
http://www.newobjects.com/pages/ndl/alp/asp-structure.htm
it says that
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.
but I made a couple of tests and couldn't verify it...
I'm asking because I had a script (I don't have it at hand right now) that using <% %> gave me an error, changing it to the <script> tag solved the problem, but I'd like to know why....
anyway, I guess that we should use the <script> tag for functions and procedures that are to be called from <% %> tags... right?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…