Documentation for: ASP.NET Ajax Version 1.0

This documentation is for a previous version. For the current released version, see the ASP.NET Ajax documentation on MSDN.








PostBackTrigger Class

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




<AspNetHostingPermissionAttribute(SecurityAction.InheritanceDemand, Level := AspNetHostingPermissionLevel.Minimal)> _
<AspNetHostingPermissionAttribute(SecurityAction.LinkDemand, Level := AspNetHostingPermissionLevel.Minimal)> _
Public Class PostBackTrigger _
	Inherits UpdatePanelControlTrigger


[AspNetHostingPermissionAttribute(SecurityAction::InheritanceDemand, Level = AspNetHostingPermissionLevel::Minimal)]
[AspNetHostingPermissionAttribute(SecurityAction::LinkDemand, Level = AspNetHostingPermissionLevel::Minimal)]
public ref class PostBackTrigger : public UpdatePanelControlTrigger


/** @attribute AspNetHostingPermissionAttribute(SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal) */
/** @attribute AspNetHostingPermissionAttribute(SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal) */
public class PostBackTrigger extends UpdatePanelControlTrigger


PostBackTriggerNew()Initializes a new instance of the PostBackTrigger class.
ControlIDGets or sets the name of the control that is an PostBackTrigger control for an UpdatePanel control. (Overrides UpdatePanelControlTrigger.ControlID.)
Equals(Object)Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Finalize()Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection. (Inherited from Object.)
FindTargetControl(Boolean)Searches for the control specified in the ControlID property. (Inherited from UpdatePanelControlTrigger.)
GetHashCode()Serves as a hash function for a particular type. (Inherited from Object.)
GetType()Gets the Type of the current instance. (Inherited from Object.)
HasTriggered()Returns a value that indicates whether the trigger was activated. (Overrides UpdatePanelTrigger.HasTriggered().)
Initialize()Initializes the PostBackTrigger object. (Overrides UpdatePanelTrigger.Initialize().)
MemberwiseClone()Creates a shallow copy of the current Object. (Inherited from Object.)
OwnerGets a reference to the UpdatePanel control that the UpdatePanelTrigger targets. (Inherited from UpdatePanelTrigger.)
ToString()Returns 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(Control) 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.


  • AspNetHostingPermission

    for operating in a hosted environment. Demand value: LinkDemand. Permission value: Minimal.

  • AspNetHostingPermission

    for operating in a hosted environment. Demand value: InheritanceDemand. Permission value: Minimal.

Inheritance Hierarchy

Assembly: System.Web.Extensions (Module: System.Web.Extensions)