Click to Rate and Give Feedback
MSDN
MSDN Library
.NET Development
.NET Framework 3.5
ASP.NET Reference
 LoginStatus Web Server Control Decl...

  Switch on low bandwidth view
This page is specific to
Microsoft Visual Studio 2008/.NET Framework 3.5

Other versions are also available for the following:
.NET Framework General Reference
LoginStatus Web Server Control Declarative Syntax

Detects the user's authentication state and toggles the state of a link to display whether the users can log on to or log off from a Web site.

<asp:LoginStatus
    AccessKey="string"
    BackColor="color name|#dddddd"
    BorderColor="color name|#dddddd"
    BorderStyle="NotSet|None|Dotted|Dashed|Solid|Double|Groove|Ridge|
                 Inset|Outset"
    BorderWidth="size"
    CssClass="string"
    Enabled="True|False"
    EnableTheming="True|False"
    EnableViewState="True|False"
    Font-Bold="True|False"
    Font-Italic="True|False"
    Font-Names="string"
    Font-Overline="True|False"
    Font-Size="string|Smaller|Larger|XX-Small|X-Small|Small|Medium|
               Large|X-Large|XX-Large"
        Font-Strikeout="True|False"
    Font-Underline="True|False"
    ForeColor="color name|#dddddd"
    Height="size"
    ID="string"
    LoginImageUrl="uri"
    LoginText="string"
    LogoutAction="Refresh|Redirect|RedirectToLoginPage"
    LogoutImageUrl="uri"
    LogoutPageUrl="uri"
    LogoutText="string"
    OnDataBinding="DataBinding event handler"
    OnDisposed="Disposed event handler"
    OnInit="Init event handler"
    OnLoad="Load event handler"
    OnLoggedOut="LoggedOut event handler"
    OnLoggingOut="LoggingOut event handler"
    OnPreRender="PreRender event handler"
    OnUnload="Unload event handler"
    runat="server"
    SkinID="string"
    Style="string"
    TabIndex="integer"
    ToolTip="string"
    Visible="True|False"
    Width="size"
/>

The LoginStatus control has two states:

  • Logged on to the Web site.

  • Logged off from the Web site.

The state is determined by the IsAuthenticated()()() property of the Request()()() property.

For more information about using the LoginStatus control and other login controls, see ASP.NET Login Controls Overview.

This following code example shows how to use the LoginStatus control to create a link for a user to log on to or log off from a Web site.

Visual Basic
<asp:LoginStatus id="LoginStatus1" loginText="Log In"
             logoutAction="Refresh" logoutText="Log Out"
             runat="server" /> 

C#
<asp:LoginStatus id="LoginStatus1" loginText="Log In"
             logoutAction="Refresh"  logoutText="Log Out"
             runat="server" /> 

Reference

LoginStatus

Other Resources

Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
Processing
© 2009 Microsoft Corporation. All rights reserved. Terms of Use  |  Trademarks  |  Privacy Statement
Page view tracker