开发者

ASP.NET AJAX Partial Rendering

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 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.


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜