.NET Framework Class Library
Login.VisibleWhenLoggedIn Property

Note: This property is new in the .NET Framework version 2.0.

Gets or sets a value indicating whether to show the Login control after the user is authenticated.

Namespace: System.Web.UI.WebControls
Assembly: System.Web (in system.web.dll)

Syntax

Visual Basic (Declaration)
<ThemeableAttribute(False)> _
Public Overridable Property VisibleWhenLoggedIn As Boolean
Visual Basic (Usage)
Dim instance As Login
Dim value As Boolean

value = instance.VisibleWhenLoggedIn

instance.VisibleWhenLoggedIn = value
C#
[ThemeableAttribute(false)] 
public virtual bool VisibleWhenLoggedIn { get; set; }
C++
[ThemeableAttribute(false)] 
public:
virtual property bool VisibleWhenLoggedIn {
    bool get ();
    void set (bool value);
}
J#
/** @property */
public boolean get_VisibleWhenLoggedIn ()

/** @property */
public void set_VisibleWhenLoggedIn (boolean value)
JScript
public function get VisibleWhenLoggedIn () : boolean

public function set VisibleWhenLoggedIn (value : boolean)

Property Value

false if the Login control should be hidden when the user is authenticated; otherwise, true. The default is true.
Remarks

The VisibleWhenLoggedIn property specifies whether the Login control is displayed to authenticated users. When the property is false, the Login control does not appear on the page when an authenticated user accesses the site. This is used on Web pages that are used both as login pages and as information pages to hide the Login control after the user has been authenticated.

The VisibleWhenLoggedIn property has no effect on a Login control that appears on the default login page defined in Web.config or in the application's configuration file.

This property cannot be set by themes or style sheet themes. For more information, see ThemeableAttribute and ASP.NET Themes and Skins Overview.

Example

The following code example sets the VisibleWhenLoggedIn property to true to specify that the Login control is not hidden and is always displayed on the page, regardless of whether the user has been authenticated.

Visual Basic
<%@ Page Language="VB" AutoEventWireup="False"%>
<html>
<head>
</head>
<body>
    <form runat="server">
        <asp:Login id="Login1" runat="server" 
           HideWhenLoggedIn="False">
        </asp:Login>
    </form>
</body>
</html>
C#
<%@ Page Language="C#" AutoEventWireup="False"%>
<html>
<head>
</head>
<body>
    <form runat="server">
        <asp:Login id="Login1" runat="server" 
           HideWhenLoggedIn="False">
        </asp:Login>
    </form>
</body>
</html>
Platforms

Windows 98, Windows 2000 SP4, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

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

Version Information

.NET Framework

Supported in: 2.0
See Also

Tags :


Page view tracker