Forum Moderators: open
HTML
HTML
HTML
<%ASP CODE%>
HTML
HTML
<%ASP CODE%>
HTML
I have noticed that no HTML will be spit to the screen until the last line of ASP code is completed. Other times with large ASP files, it will spit the first bunch of HTML code out before starting the next ASP code block. How does one determine how the ASP will operate with respect to when the HTML code will be sent to the users browser.
What I would like to do is add a quick text message at the start of the ASP file such as "Processing..." To stop other accessing scripts from timing out if the ASP does not execute quickly. But Despite the fact that I have added an HTML header and an HTML message at the start of the ASP code, it will not print it until the ASP code completely finishes.
Any Ideas?
Thanks,
"A server-side script begins to run when a browser requests an .asp file from your Web server. Your Web server then calls ASP, which processes the requested file from top to bottom, executes any script commands, and sends a Web page to the browser."
The only reason I can think of that a large ASP file would seem to pause on the browser is that it is returning out a lot of complicated HTML or client-side JavaScript.
I wonder if I can get around this with a "Response.Write".
I shall experiment.............
Result: Same dang thing. THe response.write did not render result early.
Hmmm... I'm stumped
[edited by: tesla at 11:06 pm (utc) on Nov. 8, 2002]
I believe this is just a consequence of the browser trying to render really big tables.
IIRC, some browsers (MSIE, for example) won't render a table until all of the table information has been read. If you have two huge tables, it could be reading the first table, and when it has all of the info displaying it, while the second table is still loading.
the html page starts off
<html>
<body>
<table>
asp bit
</table>
</body>
</html>
it cant render the table until it has built the table content and published </table>.
try to move away from the table and use a css this way you can design the asp to backfill areas at a time.
DaveN
If I place
<Table border=0><TR><TD>Processing . . . .</TD></TR>
</Table>
<Table border=0><TR><TD>Order Date: <%=Date%></TD></TR>
<TR><TD>Order Date: <%=Time()%> EST</TD></TR></Table>
At the start of my ASP file, it will spit it out before it continues on with the rest of the file. I Tried various combinations and it seems it wants to have two tables and some ASP code. If you remove one table, it does not work. If you remove the ASP it does not work. Its a mystery. I'm sure there are other combinations of HTML and ASP that will work, but it seems to be three required elements <HTML><HTML><ASP> And each should result in something to the screen.
I take it all back:
This was on my local site and all that was in the ASP file was the code aboved followed by a big FOR delay.
When I put the exactly code at the start of my larger ASP file on my real server, the behavior changes. On the real server I have not yet succeeded in every getting it to pause. with code like above.
I have tried adding more HTML and more intermixed ASP and nothing seems to work. I'm thinking it most have something to do with buffer sizes. My local machine has a weak buffer size and the real server has much larger. Since I know that a really large table of the real server will result in the desired behavior it tends to back up my buffer theory.
Any ideas?
Response.Buffer --> Defaults to true in ASP 3, tells server to buffer output until all scripts have been executed.
Response.Flush --> Sends all buffered data to the browser.
Also, if the browser seems to "hang" for excessive periods of time, it may be due to the browser having trouble rendering complicated tables or scripts and not due to any server-side execution. To check this, telnet into your web server and request a page. If you quickly get a response, you know it is a rendering issue with the browser. I have run into this with Netscape several times.