views:

53

answers:

4

How does the ASP.NET page rendering happens from Server to Client Browser? The question is, consider the Page has a Header and Footer which are User controls and contain many server controls.

Does ASP.NET start sending the HTML to client browser, once it gets some of the controls being rendered and converted in their respective HTML? Or does it wait for the whole page to be rendered and converted in HTML on Server, and then it sends back the Page HTML to the browser.

I am seeing that the "Page Title" of our website is shown much before and then the page takes too much time in loading completely. I want to be clear on this concept whether its server that is taking time or the client side scripts, images etc.. are the culprit. Accordingly we will start the optimizations.

Specifically I am interested in knowing how the outputstream (in response object) is sent to the Client Browser? Is the outputstream flushed once whole page is rendered in outputstream or it is sent to client in batches (i.e. few controls rendered and sent to browser via outputstream --> then some more controls are rendered and so on...)?

Sorry if am not clear enough on the problem.

+1  A: 

in terms of debugging you can turn .NET tracing on to see whats taking the time on the server side,

and use google chrome or firebug for firefox to see whats taking the time on the client side.

Andrew Bullock
A: 

User controls are rendered before controls on the .aspx page itself.

Take a look at the Page Life Cycle

TheGeekYouNeed
You might also find this blog post a good guide to the sequence of events in the page lifecycle: http://weblogs.asp.net/jeff/archive/2004/07/04/172683.aspx
Owen Blacker
A: 

I believe this is controlled by Response.BufferOutputor something similar(no reference at hand) to determine if it should start sending out HTML as soon as it's ready or if it should store it in a buffer and wait until everything is done and then send it.

Earlz
A: 

Fiddler should help determine where the bottleneck is, if you're seeing the page title show up but the page doesn't render for a bit after I'd suspect there are other files (images, javascript, css, etc) that are holding up the page from rending in the browser and not the html in the page

mdmullinax