- 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
-
8acfae7b-6ffb-47f8-9319-44b067ab3e92|0|.0