PostBackOptions.ActionUrl プロパティ
定義
重要
一部の情報は、リリース前に大きく変更される可能性があるプレリリースされた製品に関するものです。 Microsoft は、ここに記載されている情報について、明示または黙示を問わず、一切保証しません。
Web フォーム ページのポストバックの対象の URL を取得または設定します。
public:
property System::String ^ ActionUrl { System::String ^ get(); void set(System::String ^ value); };
public string ActionUrl { get; set; }
member this.ActionUrl : string with get, set
Public Property ActionUrl As String
プロパティ値
Web フォーム ページのポストバックの対象の URL。 既定値は空の文字列 ("") です。
例
次のコード例では、ユーザーがマウス ポインターをActionUrlPostBackOptionsコントロールに配置した場合に、オブジェクトのプロパティを使用してクロスページ ポストバックを実行する方法をLabel示します。
<%@ 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 xmlns="http://www.w3.org/1999/xhtml" >
<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>
<%@ 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 xmlns="http://www.w3.org/1999/xhtml" >
<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>
注釈
クラスのプロパティはActionUrl、PostBackOptionsWeb Forms ページのaction
属性の URL を指定します。 このActionUrlプロパティを使用すると、データをポストバックするWeb Forms ページを指定でき、クロスページ投稿が発生します。 クロスページ転記の詳細については、ASP.NET Web Formsでのクロスページ転記を参照してください。