PostBackOptions.ActionUrl Property


The .NET API Reference documentation has a new home. Visit the .NET API Browser on to see the new experience.

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

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

public string ActionUrl { get; set; }

Property Value

Type: System.String

The URL for the postback of a Web Forms page. The default value is an empty string ("").

The ActionUrl property of the PostBackOptions class specifies the URL for the action attribute of a Web Forms page. The ActionUrl property can be used to specify which Web Forms page to post data back to, causing a cross-page post. For more information on cross-page posting, see Cross-Page Posting in ASP.NET Web Forms.

The following code example demonstrates using the ActionUrl property of a PostBackOptions object to cause a cross-page postback if a user positions the mouse pointer on a Label control.

<%@ Page Language="C#" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">

<script runat="server">

  void Page_Init(object sender, EventArgs e)

    string reference = Page.ClientScript.GetPostBackEventReference
      (new PostBackOptions(this, "", "", false, true, false, true, false, ""));
    Label1.Attributes.Add("onmouseover", reference);



<html xmlns="" >
  <head runat="server">
    <title>ActionUrl Example Page</title>
    <form id="form1" runat="server">
      <h3>PostBackOptions ActionUrl Example</h3>
      <asp:Label runat="server" 
        id="Label1" >
        Placing the mouse pointer on this label will cause a cross-page post to occur.

.NET Framework
Available since 2.0
Return to top