Use Adapters?

The adapters are currently turned on. Do you want to keep them enabled?


more about the adapters

Theme Chooser

The examples can use either a "basic" or "enhanced" theme or no theme at all.



more about CSS & themes

LoginStatus Control Example

Example Summary and Logic

The LoginStatus control renders just a single <span> tag whose CSS class can be set using the LoginStatus' CssClass property. In the unadapted form, the <span> includes an inline style to set the border-width (zero by default). If you eschew inline styles, you can adapt the LoginStatus control to omit the style attribute on the <span>.

This is a good example of using adapters to fine tune your rendered markup. Not all adapters have to result in massive changes to the markup like you see with the Menu or TreeView adapters. It's perfectly reasonable to use adapters to make smaller changes, too.


Working Example

Hints:

If the user is logged in, the logout link is displayed. Otherwise, the login link is shown.

In both cases, the link goes to the login page.

What would you like to do next?

HTML Snippets

Snippet of HTML when using the adapters

ASP.NET
1
<a id="ctl00_ctl00_MainContent_LiveExample_loginstatus1" title="Click to login/logout." class="AspNet-LoginStatus LoginStatus-Skin" href="javascript:__doPostBack('ctl00$ctl00$MainContent$LiveExample$loginstatus1$ctl02','')">login</a>

Snippet of HTML when not using the adapters

ASP.NET
1
<a id="ctl00_ctl00_MainContent_LiveExample_loginstatus1" title="Click to login/logout." class="LoginStatus-Skin" CssSelectorClass="PrettyLoginStatus" href="javascript:__doPostBack('ctl00$ctl00$MainContent$LiveExample$loginstatus1$ctl02','')">login</a>