title: what's the difference between <% %> and <script language="vbscript" runat="server"> in classic asp?
body: <p>I couldn't find much documentation on the web</p>
  
  <p>so far now, the obvious difference seems to be that you cant mix html and vbscript using the "script" tag</p>
  
  <p>for example, this is ok</p>
  
  <pre>
  &lt;% public sub display_literal() %>
    literal
  &lt% end sub %>
  </pre>
  
  <p>but with the script tag you should</p>
  
  <pre>
  
  &lt;script language="vbscript" runat="server">
  public sub display_literal2()
      response.write "literal2&lt;/br>"
  end sub
  &lt;/script>
  </pre>
  
  <p>on this page </p>
  
  <p><a href="http://www.newobjects.com/pages/ndl/alp/asp-structure.htm" rel="nofollow noreferrer">http://www.newobjects.com/pages/ndl/alp/asp-structure.htm</a></p>
  
  <p>it says that</p>
  
  <blockquote>
    <p>In classic ASP the script written in the default script language for the page (i.e. the language assumed for the &lt;% %> tags) is executed second - e.g. all the script code in &lt;% %> tags is initialized after all the &lt;SCRIPT RUNAT=SERVER ...> scripts. </p>
  </blockquote>
  
  <p>but I made a couple of tests and couldn't verify it...</p>
  
  <p>I'm asking because I had a script (I don't have it at hand right now) that using &lt;% %> gave me an error, changing it to the &lt;script> tag solved the problem, but I'd like to know why....</p>
  
  <p>anyway, I guess that we should use the &lt;script> tag for functions and procedures that are to be called from &lt;% %> tags... right?</p>