System.Web.UI.WebControls.ImageButton.PostBackUrl Property

Gets or sets the URL of the page to post to from the current page when the System.Web.UI.WebControls.ImageButton control is clicked.

Syntax

[System.ComponentModel.Editor("System.Web.UI.Design.UrlEditor, System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", "System.Drawing.Design.UITypeEditor, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")]
[System.ComponentModel.DefaultValue("")]
[System.Web.UI.UrlProperty("*.aspx")]
[System.Web.UI.Themeable(false)]
public virtual string PostBackUrl { set; get; }

Value

Documentation for this section has not yet been entered.

Remarks

The ImageButton.PostBackUrl property allows you to perform a cross-page post using the System.Web.UI.WebControls.ImageButton control. Set the ImageButton.PostBackUrl property to the URL of the Web page to post to when the System.Web.UI.WebControls.ImageButton control is clicked. For example, specifying Page2.aspx causes the page that contains the System.Web.UI.WebControls.ImageButton control to post to Page2.aspx. If you do not specify a value for the ImageButton.PostBackUrl property, the page posts back to itself.

Note:

When performing a cross-page postback with controls with server-side validation, you should check that the page's System.Web.UI.Page.IsValid property is true before processing the postback. In the case of a cross-page postback, the page to check is the PreviousPage. The following Visual Basic code shows how this is done:

Example

Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        If Page.PreviousPage.IsValid Then
            ' Handle the post back
        Else
            Response.Write("Invalid")
        End If
End Sub

For more information on cross-page posting techniques, see Cross-Page Posting in an ASP.NET Web Page.

This property cannot be set by themes or style sheet themes. For more information, see System.Web.UI.ThemeableAttribute and ASP.NET Themes Overview.

Requirements

Namespace: System.Web.UI.WebControls
Assembly: System.Web (in System.Web.dll)
Assembly Versions: 2.0.0.0