LoginStatus.LogoutPageUrl 屬性
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
取得或設定登出頁面的 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 。
這個屬性無法由佈景主題或樣式表主題設定。 如需詳細資訊,請參閱 ThemeableAttribute 和 ASP.NET 主題和麵板。
適用於
另請參閱
意見反應
https://aka.ms/ContentUserFeedback。
即將登場:在 2024 年,我們將逐步淘汰 GitHub 問題作為內容的意見反應機制,並將它取代為新的意見反應系統。 如需詳細資訊,請參閱:提交並檢視相關的意見反應