Share via


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时,用户将重定向到 中包含的 LogoutPageUrlURL。

如果 LogoutAction 设置为任何其他值,则忽略 属性的内容 LogoutPageUrl

无法通过主题或样式表主题设置此属性。 有关详细信息,请参阅 ThemeableAttributeASP.NET 主题和外观

适用于

另请参阅