PostBackOptions Class
TOC
Collapse the table of content
Expand the table of content

PostBackOptions Class

 

Specifies how client-side JavaScript is generated to initiate a postback event.

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

System::Object
  System.Web.UI::PostBackOptions

public ref class PostBackOptions sealed 

NameDescription
System_CAPS_pubmethodPostBackOptions(Control^)

Initializes a new instance of the PostBackOptions class with the specified target control data.

System_CAPS_pubmethodPostBackOptions(Control^, String^)

Initializes a new instance of the PostBackOptions class with the specified target control and argument data.

System_CAPS_pubmethodPostBackOptions(Control^, String^, String^, Boolean, Boolean, Boolean, Boolean, Boolean, String^)

Initializes a new instance of the PostBackOptions class with the specified values for the instance's properties.

NameDescription
System_CAPS_pubpropertyActionUrl

Gets or sets the target URL for the postback of a Web Forms page.

System_CAPS_pubpropertyArgument

Gets or sets an optional argument that is transferred in the postback event.

System_CAPS_pubpropertyAutoPostBack

Gets or sets a value that indicates whether the form will automatically post back to the server in response to a user action.

System_CAPS_pubpropertyClientSubmit

Gets or sets a value indicating whether the postback event should occur from client-side script.

System_CAPS_pubpropertyPerformValidation

Gets or sets a value indicating whether client-side validation is required before the postback event occurs.

System_CAPS_pubpropertyRequiresJavaScriptProtocol

Gets or sets a value indicating whether the javascript: prefix is generated for the client-side script.

System_CAPS_pubpropertyTargetControl

Gets the control target that receives the postback event.

System_CAPS_pubpropertyTrackFocus

Gets or sets a value indicating whether the postback event should return the page to the current scroll position and return focus to the current control.

System_CAPS_pubpropertyValidationGroup

Gets or sets the group of controls for which the PostBackOptions object causes validation when it posts back to the server.

NameDescription
System_CAPS_pubmethodEquals(Object^)

Determines whether the specified object is equal to the current object.(Inherited from Object.)

System_CAPS_pubmethodGetHashCode()

Serves as the default hash function. (Inherited from Object.)

System_CAPS_pubmethodGetType()

Gets the Type of the current instance.(Inherited from Object.)

System_CAPS_pubmethodToString()

Returns a string that represents the current object.(Inherited from Object.)

The PostBackOptions class allows controls to emit client-side script that initiates a postback event. The PostBackOptions class also provides a reference to the control that initiated the postback event through the TargetControl property. The postback event is created based on the options specified in the PostBackOptions object passed in to the ClientScriptManager::GetPostBackEventReference method.

Normally, a postback to the server is initiated by elements such as a Submit button or an Image button. However, by emitting client-side JavaScript, different controls can initiate a postback event.

The following code example uses the OnClick event of a Button control to generate client-side script for a HyperLink control that will allow the HyperLink control to cause a postback event. Because the ActionUrl property of the myPostBackOptions object is set to "Page2.aspx", the postback will post the Web Forms page to another page named "Page2.aspx", which is not provided here. To use this example, you must add another Web page named "Page2.aspx" to your project or directory.

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

The following code example is a Web page that can be used to run the preceding code-behind file.

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

.NET Framework
Available since 2.0

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

Return to top
Show:
© 2016 Microsoft