Export (0) Print
Expand All

PostBackTrigger Class

Defines a control inside a UpdatePanel control as a postback control.

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

type PostBackTrigger =  
        inherit UpdatePanelControlTrigger 

The PostBackTrigger type exposes the following members.

Public methodPostBackTriggerInitializes a new instance of the PostBackTrigger class.

Public propertyControlIDGets or sets the name of the control that is an PostBackTrigger control for an UpdatePanel control.
Public propertyOwnerGets a reference to the UpdatePanel control that the UpdatePanelTrigger targets. (Inherited from UpdatePanelTrigger.)

Public methodEquals(Object)Determines whether the specified object is equal to the current object. (Inherited from Object.)
Protected methodFinalizeAllows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.)
Protected methodFindTargetControlSearches for the control specified in the ControlID property. (Inherited from UpdatePanelControlTrigger.)
Public methodGetHashCodeServes as the default hash function. (Inherited from Object.)
Public methodGetTypeGets the Type of the current instance. (Inherited from Object.)
Protected methodHasTriggeredReturns a value that indicates whether the trigger was activated. (Overrides UpdatePanelTrigger.HasTriggered().)
Protected methodInitializeInitializes the PostBackTrigger object. (Overrides UpdatePanelTrigger.Initialize().)
Protected methodMemberwiseCloneCreates a shallow copy of the current Object. (Inherited from Object.)
Public methodToStringReturns a string that represents the current PostBackTrigger object. (Overrides Object.ToString().)

Use the PostBackTrigger control to enable controls inside an UpdatePanel to cause a postback instead of performing an asynchronous postback.

Use the RegisterPostBackControl method of the ScriptManager control to programmatically register a postback control. You can then call the Update method of the UpdatePanel control when the trigger control performs a postback.


Programmatically adding PostBackTrigger controls is not supported.

If a control is set as both a PostBackTrigger and AsyncPostBackTrigger control, an exception is thrown.

The following example shows how to declaratively define a PostBackTrigger control for an UpdatePanel control. In the panel, a FileUpload control enables users to upload a file. Users must first check whether the file to upload exists. The Button control that calls the event handler to check the file name causes an asynchronous postback. However, the Button control that uploads the file is registered as a PostBackTrigger, because files cannot be uploaded asynchronously.

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

.NET Framework

Supported in: 4.6, 4.5, 4, 3.5

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
© 2015 Microsoft