Sunday, March 11, 2012

UpdatePanel and Viewstate and speed

hello.

well, UpdatePanel really makes it easy to transform a normal ASP.NET page into an AJAX page. howeverm it has some drawbacks. since it gives you the commodity of working on the server side as if you're in a normal postback, then it needs to send everything back (including hidden form fields) so that the controls can be correctly instantiated and you can use them without any worries.

the response coming from the server must update the HTML of the zone delimited by the updatepanel but it also must update the viewstate so that when you do a postback or another partial postback the controls work as expected (ie, they must be updated with the corect state, etc, etc).

resuming, the bheavior you're having is normal and happens more frequently than you might expect. if you really want speed, you 'll have to go with the client side approach where only the data are being returned from the server side. yes, with this appraoch, you must have good javascript skills.

however, if you really need to use the panel, then you should disable the view state of the page. one more thing: UpdatePanels won't get you quicker pages in most scenarios. it only gives you easy of use when building an ajax page.

No comments:

Post a Comment