How do I start writing a table to the browser berfore all rows are rendered?

M

mortb

Hi!

I have a really large and complex table.
The table may consist of several thousand rows.
When I render the table with asp.net web controls the control won't stream
out to the browser before the appending of rows is completed.
The table is created in a custom web control. I know I can use
Response.Write to directly output to the client, but I'd like to know if
there is another way.

cheers,
mortb
 
A

Aidy

This is how IE behaves (not sure about other browsers). The table is being
streamed to the browser, but IE will only render it when it has the complete
table. It is only when it gets all rows that it can know how the table is
to look.
 
P

Patrice

Generally you need to close the table tag before the browser is able to
render the whole table. In this case you could also try the table-layout
attribute :
http://msdn.microsoft.com/library/d...or/dhtml/reference/properties/tablelayout.asp
that should allows to render one row at a time (you'll need also to disable
buffering).

My personal preference would be likely to page data if possible (and/or
rendering filtered data). Are those rows browsed by a user ? Doesn't he have
a search or filtering mechanism to find what he is interested among those
several thousands of rows ?

Please let us know if table-layout worked...
 
?

=?ISO-8859-1?Q?G=F6ran_Andersson?=

mortb said:
Hi!

I have a really large and complex table.
The table may consist of several thousand rows.
When I render the table with asp.net web controls the control won't stream
out to the browser before the appending of rows is completed.
The table is created in a custom web control. I know I can use
Response.Write to directly output to the client, but I'd like to know if
there is another way.

No, there is no other way. When you are using server controls, none of
the final html code exist before all server controls are added to the page.

You can use Response.Write and Response.Flush to create output and flush
it to the browser. Don't make a flush after each row, though. Then you
would be sending each row in a separate TCP/IP package, which would
produce a huge amount of overhead.

Also consider what Patrice said about paging and filtering. The user
might not even want what you are trying to do now.
 
M

mortb

There is paging, the customer wants to be able to show the whole result at a
time, though. DOH! ;-)

If I'd draw the table usining response write I guess that means that that
the whole page would have to be output using response write wouldn't it lead
to better performance if I'd put the page in a httphandler instead of an
aspx page?

thanks for the replies!
/mortb
 

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

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,009
Latest member
GidgetGamb

Latest Threads

Top