Onlineatoz.net | ToolBox Login Control LoginName

ToolBox Login Control LoginName

LoginName Web Server Control

in ASP.NET environment,This article describes you how to work with LoginName Web Control.The LoginName control provide the name that exist in the User Property of the Page class.The Control will not be provided when the System.Web.UI.Page.User.Identity.Name property is empty. By using FormatString property, We can change the text displayed by the LoginName control.

The following code snippets shows how to work with the LoginName.

in .aspx.cs page,

void Button1_Click(Object sender, EventArgs e) {
        LoginName1.FormatString = "your text";
         Button1.Visible = false;
    }

in .aspx file,

<html>
<head>
</head>
<body>
    <form id="Form2" runat="server">
        <p>
            <asp:LoginName id="LoginName1" runat="server" 
               FormatString ="Thanks, {0}" />
        </p>
        <p>
            <asp:Button id="Button1" onclick="Button1_Click" runat="server" 
               Text="Change" />
        </p>
    </form>
</body>
</html>
                    
 
Related Links

Posted by: Admin
Posted on: 9/13/2011 at 2:32 PM
Categories: Asp.net
Actions: E-mail | Kick it! | DZone it! | del.icio.us
Post Information: Permalink | Comments (0) | Post RSSRSS comment feed