tags:

views:

54

answers:

2

Hello,

I have a question about how ASP.NET AJAX partial rendering actually works. Does it:

1) Renders the whole page on the server, transmits the whole page to the client, the client then merges just the area contained in the update panel.

2) Renders the whole page on the server, transmits and merges just the area contained by the update panel.

3) Renders, transmits and merges just the area contained by the update panel.

Thanks,

AJ

+2  A: 

2 is the answer - Partial-Page Rendering Overview:

An asynchronous postback behaves much like a synchronous postback. All the server page life-cycle events occur, and view state and form data are preserved. However, in the rendering phase, only the contents of the UpdatePanel control are sent to the browser. The rest of the page remains unchanged.

jball
Working link: http://msdn.microsoft.com/en-us/library/bb386573.aspx
Michael Kropat
+1  A: 

It depends on which method you use. If you use an UpdatePanel then it is almost like a full postback, the page goes through its entire lifecycle and then just the content of the UpdatePanel is sent back to the browser. You could also use something like PageMethods to only send the data that your method needs, and have that method return the new html that you can then place in the page (most likely in some div). This is much more efficent, but takes a little more time to setup. Check out this link for a comparison of UpdatePanel versus PageMethods and how to implement each.

Matt Dearing