Stupid question but which way is faster, if at all?
orCode:<%
Response.Write "File # " & strfilenum
%>
ThanksCode:File # <%=strfilenum%>
Printable View
Stupid question but which way is faster, if at all?
orCode:<%
Response.Write "File # " & strfilenum
%>
ThanksCode:File # <%=strfilenum%>
Technically, the second, since it doesn't have to concatenate the string first. However the difference is so marginal that you'll probably never notice.
That's what I though, however if I'm iterating through a recordset I'd like for it to be as fast as possible.
In that case, avoid changing between ASP / HTML. As in, the second way, it swaps between them. If you're looping through a recordset, keep it all in ASP code for speed.
Sounds good.
Thanks,
There isn't any difference apart from the concatenation as mentioned.
If you have an error in what is being outputed using the <% = blah %>, the error message that comes up is Error - type mismatch in response.write(blah).
so I don't think there is any difference apart from the time it takes to write it.
Ian
I always considered the first to be typically faster, if you stayed in ServerSide script long
for example
<%
.....
%>
the doted line being several lines , and all responses are sent with Response.write, and %> isnt reached until page is finished.