ASP.NET Syntax ASP.NET Syntax for Web Controls
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.
Declarative Syntax
<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
/>
For information on the individual members of this class, see LoginStatus in the class library.
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.
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.
<asp:loginstatus id="LoginStatus1" runat="server"
logintext = "Log In"
logoutaction = "Refresh"
logouttext = "Log Out" />
LoginStatus Class LoginStatus Web Server Control