Speeding up page display

T

Troy

Hello all,

I was wondering if there is a way to speed up the rendering of a web page
to the client browser... In my case, I am retrieving about 60 - 100 rows of
data from an SQL Server and I wish to display these rows the client as I am
retrieving them (while looping). I get the results from SQL and populate a
dataset, then I loop through the dataset and add the data to an
<asp:tablecell> object on the aspx page. Part of the data I retrieve is a
URL which points to an image on the server (the image is not stored in SQL,
just the path) of which I add then add an image control to the web page. I
believe it is in this area that takes most of the time.

It looks like the client/browser waits untill the entire contents of the
table are populated (60 - 100 table cells) before it will render the page.
My question is: Is there a way to tell the browser to start showing the
images as my code loops through the dataset? I have tried setting the
response.bufferoutput to false, but it actually did not start displaying
each row as it was added - it waited till they all were added and then
rendered the page and it took longer than response.bufferoutput = true
configuration.

I was thinking of using response.flush() after every 10 or 20 loops
through the data set.... will this work and receive an increase in
performance? Thanks for any help with this matter!!!

Regards,

Troy
 
G

George Ter-Saakov

1. Browser (IE) displays table only once it has all HTML for that table.
So even if you are spiting out HTML using Response.Flush browser will not
show the table until tag </table> is received.

2. When exactly do you call Response.Flush?
When you adding Row object to the Table object it does not produce HTML
right away.
HTML will be generated only on when RenderControl method is called.
And it's called almost at the end of the request.

So my point is that you are just wasting time by calling Response.Flush
since no HTML was generated.


---------------

If you want to have such behavior you got to
1. No table
2. Use inline code as you would in regular ASP (Response.Write) to produce
output.

George.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,065
Latest member
OrderGreenAcreCBD

Latest Threads

Top