Source view of LOGINNAME.ASPX
DotNet Funda: Code Viewer
loginname.aspx | loginname.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:LoginName control</td>
        </tr>
        <tr>
            <td class="ArticleContents">
                LoginName control is used to display current logged in user name.
            </td>
        </tr>
        <tr>
            <td colspan="2">&nbsp;</td>
        </tr>
    </table>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="PlaceHolderForContents" Runat="Server">
    <div class="ArticleContents">
        LoginName control is used to display current logged in user name. If the user is not logged in, this page doesn't render any thing.
        This control gets the value by using Page.Identity.Name.
        <p>
            Its properties like <span class="DemoCP">BackColor, ForeColor, BorderColor, BorderStyle, BorderWidth, Height etc. </span>
            are implemented through style properites of &lt;span/&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/loginname.aspx" target="_blank">Show Source Code</a>
                </td>
            </tr>
            <tr>
                <td>
                   
                   <asp:HyperLink ID="hyperLogin" runat="Server" onclick="javascript:ShowMeHideAnother('divLogin', 'divRegister')" NavigateUrl="javascript:void(0)" ToolTip="Toggle display the Login Form"><asp:Image ID="Image2" runat="server" ImageUrl="~/images/zoomLH.gif" ImageAlign="Middle" />Login to see LoginName control demo</asp:HyperLink> <br />
                   <asp:LoginName ID="LoginName1" runat="server" FormatString="LoginName Demo: Welcome, {0}" ForeColor="Blue" BorderColor="ActiveBorder" BorderStyle="Double" />
                   
                </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>                    
// LoginName Control ////////////////////////////          
&lt;asp:LoginName ID="LoginName1" runat="server" FormatString="LoginName Demo: Welcome, {0}" ForeColor="Blue" BorderColor="ActiveBorder" BorderStyle="Double" /&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