Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Order Of Execution

Status
Not open for further replies.

RebelFox

Programmer
Jun 16, 2002
62
GB
Hi,

I have a ASP page which is coded to do the following tasks:-

1) Create a recordset/connection.

2) In a while not end of recordset loop, 'Response.Write'
the fields to the displayed page in a html table.
I have multiple '<% %>' blocks within the table html
code.

3) At the very end of my script, I 'Repsonse.Write' the
the number of records in the recordset.

Everything works a treat except for the order of execution.
For some reason my Response.Write to show the count of records in the record set is written to the browser page BEFORE the table of returned records...even though that part of the code is last in my script.

Can somebody explain why this is? Is it because of the embedded html?


 
You can use
<% response.buffer = true %>

This stores all executed in a temp buffr, IIS is done it dumps the whole page to the client....

[ponder] krK
 
I would need to see the whole code in orde to see why it is displaying out of order. It's possible that you are outputting the recordcount before you close the table, which the browser would display before the table because it woudn't be in a table cell.

-Tarwn ________________________________________________________________________________
Sometimes it is how you ask the question: faq333-2924
Many ASP questions have already been answered, please check faq333-3048 and use the search tool before posting
 
Try putting your number of records inside the HTML table in a row at the bottom outside the loop.

If you put your final response.write outside the HTML table it may appear before the table.

BDC
 
Thanks chaps.

I was placing the code inside the table.
Doh!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top