"How do I make my ASP pages more efficient" - http://www.aspfaq.com/show.asp?id=2424
"Does order matter when using different languages in ASP" - http://www.aspfaq.com/show.asp?id=2045
The way it was explained to me many moons ago was that when you call a page with the .asp extension, an instance of asp.dll is invoked with associated server overhead to establish the instance. When the %> is found, the instance is shutdown - again with associated overhead. Intertwining asp and html either instantiates asp.dll for the page, or shuts it down whenever you change between asp and html. This little snippet from MS appears to support that ...
"Keep blocks of ASP server-side script together, rather than switching back and forth between server-side and client-side code. This switching usually happens when concatenating HTML with simple values from ASP, as when you are writing out an HTML table:
<% For iCtr = 1 to 10 %>
<TR><TD>Counting ... <%= iCtr %></TD></TR>
<% Next %>
You can improve the code's by making it a single script block:
<% For iCtr = 1 to 10
Response.Write "<tr><td>Counting " & iCtr & "</td></tr>"
Next
%>
This technique has shown measurable and significant performance improvements."
BTW... The problem is even more pronounced with javascript... the interpreter instantiates after each CF/LF. If you note the javascripts available on the code sites. Those complicated ones done by very experienced javascript developers have had the cr/lf's removed. The scripts are all on a single line.
Wnen all is said and done however, being able to work with our code is also very important. I'd only worry about it if you have performance problems with the page, or if you have high utilization.
Edited by dpyers