LoginStatus.LogoutPageUrl 屬性

定義

取得或設定登出頁面的 URL。

public:
 virtual property System::String ^ LogoutPageUrl { System::String ^ get(); void set(System::String ^ value); };
[System.Web.UI.Themeable(false)]
public virtual string LogoutPageUrl { get; set; }
[<System.Web.UI.Themeable(false)>]
member this.LogoutPageUrl : string with get, set
Public Overridable Property LogoutPageUrl As String

屬性值

包含登出頁面之 URL 的字串。 預設為 Empty

屬性

範例

下列程式碼範例會將 LogoutPageUrl 屬性設定為登出頁面, LogoutAction 並將 屬性設定為 Redirect ,以便在登出時重新導向使用者。

<%@ Page Language="C#" AutoEventWireup="False" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
    <title>ASP.NET Example</title>
</head>
<body>
    <form id="form1" runat="server">
    <asp:LoginStatus id="LoginStatus1" runat="server"
       LogoutAction="Redirect" 
       LogoutPageUrl="LogoutPage.aspx"/>
       
    </form>
    </body>
</html>
<%@ Page Language="VB" AutoEventWireup="False" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
    <title>ASP.NET Example</title>
</head>
<body>
    <form id="form1" runat="server">
    <asp:LoginStatus id="LoginStatus1" runat="server"
       LogoutAction="Redirect" 
       LogoutPageUrl="LogoutPage.aspx"/>
       
    </form>
    </body>
</html>

備註

LogoutAction當 屬性設定為 Redirect 時,系統會將使用者重新導向至 中包含的 LogoutPageUrl URL。

如果 LogoutAction 設定為任何其他值,則會忽略 屬性的內容 LogoutPageUrl

這個屬性無法由佈景主題或樣式表主題設定。 如需詳細資訊,請參閱 ThemeableAttributeASP.NET 主題和麵板

適用於

另請參閱