LoginName::FormatString Property
Provides a format item string to display.
Assembly: System.Web (in System.Web.dll)
| Exception | Condition |
|---|---|
| FormatException | The format string is not valid. |
The FormatString property contains a standard text format string that displays the user's name on the Web page. The string "{0}" indicates where in the string the user's name is inserted. The following table describes the available property settings.
Property setting | Behavior |
|---|---|
Default ("{0}") | The user's name is displayed when the user is logged on; otherwise, nothing is displayed. |
Same as default. To hide the control, set the Visible property to false. | |
"Welcome to my site, {0}." | Displays the string "Welcome to my site, username." when the user is logged in. When the user is not logged in, nothing is displayed. |
"Welcome to my site." | When the FormatString property is set to a string, the string is displayed when the user is logged in. Because the string does not contain "{0}", the user's name is not displayed. When the user is not logged in, nothing is displayed. |
The value of this property, when set, can be saved automatically to a resource file by using a designer tool. For more information, see LocalizableAttribute and ASP.NET Globalization and Localization.
Windows 7, Windows Vista, Windows XP SP2, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP Starter Edition, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003, Windows Server 2000 SP4, Windows Millennium Edition, Windows 98
The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.