Click to Rate and Give Feedback
MSDN
MSDN Library
.NET Development
.NET Framework 3.5
 ActionUrl Property
Collapse All/Expand All Collapse All
This page is specific to
Microsoft Visual Studio 2008/.NET Framework 3.5

Other versions are also available for the following:
.NET Framework Class Library
PostBackOptions..::.ActionUrl Property

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)
Visual Basic (Declaration)
Public Property ActionUrl As String
Visual Basic (Usage)
Dim instance As PostBackOptions
Dim value As String

value = instance.ActionUrl

instance.ActionUrl = value
C#
public string ActionUrl { get; set; }
Visual C++
public:
property String^ ActionUrl {
    String^ get ();
    void set (String^ value);
}
JScript
public function get ActionUrl () : String
public function set ActionUrl (value : String)

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 Pages.

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.

Visual Basic
<%@ Page Language="VB" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<script runat="server">

  Sub Page_Init(ByVal sender As Object, ByVal e As EventArgs)

    Dim reference As String = Page.ClientScript.GetPostBackEventReference _
      (New PostBackOptions(Me, "", "http://www.wingtiptoys.com", False, True, False, True, False, ""))
    Label1.Attributes.Add("onmouseover", reference)

  End Sub

</script>

<html  >
  <head id="Head1" runat="server">
    <title>ActionUrl Example Page</title>
  </head>
  <body>
    <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.
      </asp:Label>
    </form>
  </body>
</html>
C#
<%@ Page Language="C#" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<script runat="server">

  void Page_Init(object sender, EventArgs e)
  {

    string reference = Page.ClientScript.GetPostBackEventReference
      (new PostBackOptions(this, "", "http://www.wingtiptoys.com", false, true, false, true, false, ""));
    Label1.Attributes.Add("onmouseover", reference);

  } 

</script>

<html  >
  <head runat="server">
    <title>ActionUrl Example Page</title>
  </head>
  <body>
    <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.
      </asp:Label>
    </form>
  </body>
</html>

Windows 7, Windows Vista, Windows XP SP2, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP Starter Edition, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003, Windows Server 2000 SP4, Windows Millennium Edition, Windows 98

The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

.NET Framework

Supported in: 3.5, 3.0, 2.0
Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
Processing
© 2010 Microsoft Corporation. All rights reserved. Terms of Use | Trademarks | Privacy Statement
Page view tracker