This documentation is archived and is not being maintained.

UpdatePanelUpdateMode Enumeration

Represents the possible update modes for the content in an UpdatePanel control.

Namespace:  System.Web.UI
Assembly:  System.Web.Extensions (in System.Web.Extensions.dll)

type UpdatePanelUpdateMode

Member nameDescription
AlwaysThe content of the UpdatePanel control is updated for all postbacks that originate from the page. This includes asynchronous postbacks.
ConditionalThe content of the UpdatePanel control is updated under the following conditions:
  • If the Update method of the UpdatePanel control is called explicitly.

  • If a control is defined as a trigger by using the Triggers property of the UpdatePanel control and causes a postback. In this scenario, the control is an explicit trigger for updating the panel content. The trigger control can be either inside or outside the UpdatePanel control that defines the trigger.

  • If the ChildrenAsTriggers property is set to true and a child control of the UpdatePanel control causes a postback. In this scenario, child controls of the UpdatePanel control are implicit triggers for updating the panel. Child controls of nested UpdatePanel controls do not cause the outer UpdatePanel control to be updated unless they are explicitly defined as triggers.

The UpdatePanelUpdateMode enumeration defines the possible update modes for the content of an UpdatePanel control. The UpdateMode property must be set to one of the values of the UpdatePanelUpdateMode enumeration. The UpdatePanel control requires that the EnablePartialRendering property of the ScriptManager control be true for partial-page rendering to occur.

The default value of the UpdateMode property is Always.

If the UpdatePanel control is inside another UpdatePanel control and the parent panel is updated, the nested panel will also be updated regardless of the UpdateMode property value.

The following example declares two UpdatePanel controls. The first panel sets the UpdateMode property of an UpdatePanel control to Conditional. The second panel has UpdateMode set to Always by default. A button outside both panels is registered as an asynchronous postback control by using the RegisterAsyncPostBackControl method of the ScriptManager control. In the button's click event handler, the Update method of the first panel is called if more than five seconds have elapsed since its last update. In this scenario, the panel's content is updated only if the last panel update was more than five seconds ago. The second panel's content is always updated.

No code example is currently available or this language may not be supported.

.NET Framework

Supported in: 4, 3.5

Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.