Source view of LOGINSTATUS.ASPX
DotNet Funda: Code Viewer
loginstatus.aspx | loginstatus.aspx.cs
Close Window  
<asp:Content ID="Content1" ContentPlaceHolderID="PlaceHolderHeader" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="PlaceHolderForTitleAndIntro" Runat="Server">
    <table width="100%" cellpadding="2" cellspacing="0">
        <tr valign="top" class="ArticleTitle">
            <td style="padding-left:10px;" valign="middle">
                asp:LoginStatus control</td>
        </tr>
        <tr>
            <td class="ArticleContents">
                LoginStatus control is a very simple and compact control that displays either Login (if user is not nog logged in) or Logout (if user is logged in).
            </td>
        </tr>
        <tr>
            <td colspan="2">&nbsp;</td>
        </tr>
    </table>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="PlaceHolderForContents" Runat="Server">
    <div class="ArticleContents">
        LoginStatus control is a very simple and compact control that displays either Login (if user is not nog logged in) or Logout (if user is logged in).
        When Login link is clicked, it automatredirects 
        Internally, When it is rendered on the page, it is implemented through &lt;table&gt;&lt;/table&gt; HTML tag.
        <p>
            Its properties like <span class="DemoCP">BackColor, ForeColor, BorderColor, BorderStyle, BorderWidth, Height etc. </span>
            are implemented through style properites of &lt;table, tr, td/&gt; tag. 
        </p>
                
        <!-- START - Demo Section -->
        <table class="DemoPlaceHolder" border="1" cellpadding="2" cellspacing="4">
            <tr>
                <td class="DemoTitle">
                    DEMO : LoginView
                </td>
                <td align="right">
                    <a class="DemoShowSource" href="../../misc/codeviewer/default.aspx?pagename=~/tutorials/controls/loginstatus.aspx" target="_blank">Show Source Code</a>
                </td>
            </tr>
            <tr>
                <td>
                
                    <asp:LoginView ID="LoginView1" runat="Server">
                        <AnonymousTemplate>
                            <span style="font-family: Arial; font-size: 10pt;">Welcome, Guest
                                <asp:LoginStatus ID="LoginStatus1" runat="Server" />
                            </span>
                        </AnonymousTemplate>
                        <LoggedInTemplate>
                            Welcome,
                            <asp:LoginName ID="LoginName1" runat="Server" />
                            <asp:LoginStatus ID="LoginStatus1" runat="Server" />
                        </LoggedInTemplate>
                        
                    </asp:LoginView>
                </td>
                <td>
                    For working example, Please <a target="_blank" href="<%= Resources.SiteConfiguration.DemoProjectUrl %>">visit</a> or <a target="_blank" href="<%= Resources.SiteConfiguration.DemoProjectDownloadUrl %>">Download</a>.
                </td>
            </tr>
            <tr>
                <td colspan="2">
                    <!-- START - Server Side Code -->
                    <pre>                    
// LoginView Control ////////////////////////////          
&lt;asp:LoginView ID="LoginView1" runat="Server"&gt;
    &lt;AnonymousTemplate&gt;
        &lt;span style="font-family: Arial; font-size: 10pt;"&gt;Welcome, Guest
            &lt;asp:LoginStatus ID="LoginStatus1" runat="Server" /&gt;
        &lt;/span&gt;
    &lt;/AnonymousTemplate&gt;
    &lt;LoggedInTemplate&gt;
        Welcome,
        &lt;asp:LoginName ID="LoginName1" runat="Server" /&gt;
        &lt;asp:LoginStatus ID="LoginStatus1" runat="Server" /&gt;
    &lt;/LoggedInTemplate&gt;

                    </pre> 
                    <!-- END - Server Side Code -->
                </td>
            </tr>
        </table>
        <!-- END - Demo Section -->
        </div>
    <br />
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="PlaceHolderFooter" Runat="Server">
</asp:Content>

Go Top