Skip to main content
How Do I: Use the Conditional UpdateMode of the UpdatePanel?
Entry Date: Rate:
Site:
Keywords:
RSS Description:
The ASP.NET AJAX UpdatePanel includes an UpdateMode property that may be set to ‘Always’ or ‘Conditional’. The default is Always, in which case the UpdatePanel will always update its content during an asychronous postback. In this video we learn how we can set the UpdateMode to Conditional, in which case the UpdatePanel will only update its content when our server-side code calls its Update method. This allows you to use conditional logic in your C# or Visual Basic code to determine whether the UpdatePanel will update its content during the current asynchronous postback.
Comments:

When you start developing using AJAX ASP .net, on your localhost... everything works magically with good performance, AJAX is quite easy isn't it? Why the people go for more complicated stuff like script services? Just drop a bunch of UpdatePanels and everythings works fine no need to go for more complex code... well that's only true on your localhost :-), once you publish your site on your remote server things change...

By default UpdatePanels get all updated in every request, you can modify this behaviour by setting the UpdateMode to Conditional and you set in your sever side code which update panel gets updated (by doing this you can reduce the size of the response sent to the client).