System.Web.UI.ClientScriptManager.GetPostBackEventReference Method

Returns a string that can be used in a client event to cause postback to the server. The reference string is defined by the specified System.Web.UI.PostBackOptions object. Optionally, registers the event reference for validation.

Syntax

public string GetPostBackEventReference (PostBackOptions options, bool registerForEventValidation)

Parameters

options
A System.Web.UI.PostBackOptions that defines the postback.
registerForEventValidation
true to register the event reference for validation; otherwise, false.

Returns

A string that, when treated as script on the client, initiates the client postback.

Remarks

To implement the System.Web.UI.IPostBackEventHandler interface for a System.Web.UI.Page object, use the @ Implements directive.

The erload:System.Web.UI.ClientScriptManager.GetPostBackEventReference method can be used with the System.Web.UI.WebControls.Button control when the System.Web.UI.WebControls.Button.UseSubmitBehavior property is false. In this scenario, the erload:System.Web.UI.ClientScriptManager.GetPostBackEventReference method returns the client postback event for the System.Web.UI.WebControls.Button control.

If registerForEventValidation is true, the ClientScriptManager.GetPostBackEventReference(PostBackOptions, bool) method calls the ClientScriptManager.RegisterForEventValidation(string, string) method to register the event reference for validation with a unique control ID that represents the client control that is generating the event.

Requirements

Namespace: System.Web.UI
Assembly: System.Web (in System.Web.dll)
Assembly Versions: 2.0.0.0
Since: .NET 2.0