-
Notifications
You must be signed in to change notification settings - Fork 1.6k
/
LoginName.xml
346 lines (318 loc) · 21.5 KB
/
LoginName.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
<Type Name="LoginName" FullName="System.Web.UI.WebControls.LoginName">
<TypeSignature Language="C#" Value="public class LoginName : System.Web.UI.WebControls.WebControl" />
<TypeSignature Language="ILAsm" Value=".class public auto ansi beforefieldinit LoginName extends System.Web.UI.WebControls.WebControl" />
<TypeSignature Language="DocId" Value="T:System.Web.UI.WebControls.LoginName" />
<TypeSignature Language="VB.NET" Value="Public Class LoginName
Inherits WebControl" />
<TypeSignature Language="F#" Value="type LoginName = class
 inherit WebControl" />
<TypeSignature Language="C++ CLI" Value="public ref class LoginName : System::Web::UI::WebControls::WebControl" />
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Base>
<BaseTypeName>System.Web.UI.WebControls.WebControl</BaseTypeName>
</Base>
<Interfaces />
<Attributes>
<Attribute>
<AttributeName Language="C#">[System.ComponentModel.Bindable(false)]</AttributeName>
<AttributeName Language="F#">[<System.ComponentModel.Bindable(false)>]</AttributeName>
</Attribute>
<Attribute>
<AttributeName Language="C#">[System.ComponentModel.DefaultProperty("FormatString")]</AttributeName>
<AttributeName Language="F#">[<System.ComponentModel.DefaultProperty("FormatString")>]</AttributeName>
</Attribute>
<Attribute FrameworkAlternate="netframework-2.0;netframework-3.0;netframework-3.5">
<AttributeName Language="C#">[System.ComponentModel.Designer("System.Web.UI.Design.WebControls.LoginNameDesigner,System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")]</AttributeName>
<AttributeName Language="F#">[<System.ComponentModel.Designer("System.Web.UI.Design.WebControls.LoginNameDesigner,System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")>]</AttributeName>
</Attribute>
<Attribute FrameworkAlternate="netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netframework-4.8.1">
<AttributeName Language="C#">[System.ComponentModel.Designer("System.Web.UI.Design.WebControls.LoginNameDesigner,System.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")]</AttributeName>
<AttributeName Language="F#">[<System.ComponentModel.Designer("System.Web.UI.Design.WebControls.LoginNameDesigner,System.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")>]</AttributeName>
</Attribute>
</Attributes>
<Docs>
<summary>Displays the value of the <see langword="System.Web.UI.Page.User.Identity.Name" /> property.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
In this topic:
- [Introduction](#introduction)
- [Accessibility](#accessibility)
- [Declarative Syntax](#declarative_syntax)
<a name="introduction"></a>
## Introduction
By default, the <xref:System.Web.UI.WebControls.LoginName> control displays the name contained in the <xref:System.Web.UI.Page.User%2A> property of the <xref:System.Web.UI.Page> class. If the `System.Web.UI.Page.User.Identity.Name` property is empty, the control is not rendered.
> [!NOTE]
> If you are not familiar with the set of login controls available in ASP.NET, see [ASP.NET Login Controls Overview](https://learn.microsoft.com/previous-versions/aspnet/ms178329(v=vs.100)) before continuing. For a list of other topics related to login controls and membership, see [Managing Users by Using Membership](https://learn.microsoft.com/previous-versions/aspnet/tw292whz(v=vs.100)).
To change the text displayed by the <xref:System.Web.UI.WebControls.LoginName> control, set the <xref:System.Web.UI.WebControls.LoginName.FormatString%2A> property.
> [!NOTE]
> The <xref:System.Web.UI.WebControls.LoginName> control cannot be used outside the `<form>` tag on a Web page. Specifically, the <xref:System.Web.UI.WebControls.LoginName> cannot be used to put the user's name in the title of a page.
<a name="accessibility"></a>
## Accessibility
For information about how to configure this control so that it generates markup that conforms to accessibility standards, see [Accessibility in Visual Studio and ASP.NET](https://learn.microsoft.com/previous-versions/ms228004(v=vs.140)) and [ASP.NET Controls and Accessibility](https://learn.microsoft.com/previous-versions/ms227996(v=vs.140)).
<a name="declarative_syntax"></a>
## Declarative Syntax
```
<asp:LoginName
AccessKey="string"
BackColor="color name|#dddddd"
BorderColor="color name|#dddddd"
BorderStyle="NotSet|None|Dotted|Dashed|Solid|Double|Groove|Ridge|
Inset|Outset"
BorderWidth="size"
CssClass="string"
Enabled="True|False"
EnableTheming="True|False"
EnableViewState="True|False"
Font-Bold="True|False"
Font-Italic="True|False"
Font-Names="string"
Font-Overline="True|False"
Font-Size="string|Smaller|Larger|XX-Small|X-Small|Small|Medium|
Large|X-Large|XX-Large"
Font-Strikeout="True|False"
Font-Underline="True|False"
ForeColor="color name|#dddddd"
FormatString="string"
Height="size"
ID="string"
OnDataBinding="DataBinding event handler"
OnDisposed="Disposed event handler"
OnInit="Init event handler"
OnLoad="Load event handler"
OnPreRender="PreRender event handler"
OnUnload="Unload event handler"
runat="server"
SkinID="string"
Style="string"
TabIndex="integer"
ToolTip="string"
Visible="True|False"
Width="size"
/>
```
## Examples
The following code example shows how to use the <xref:System.Web.UI.WebControls.LoginName> class on a page. Clicking the button changes the display format.
:::code language="aspx-csharp" source="~/snippets/csharp/VS_Snippets_WebNet/LoginNameTextFormat/CS/loginnametextformatcs.aspx" id="Snippet1":::
:::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/LoginNameTextFormat/VB/loginnametextformatvb.aspx" id="Snippet1":::
]]></format>
</remarks>
<related type="Article" href="https://learn.microsoft.com/previous-versions/aspnet/ms178329(v=vs.100)">ASP.NET Login Controls Overview</related>
</Docs>
<Members>
<Member MemberName=".ctor">
<MemberSignature Language="C#" Value="public LoginName ();" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor() cil managed" />
<MemberSignature Language="DocId" Value="M:System.Web.UI.WebControls.LoginName.#ctor" />
<MemberSignature Language="VB.NET" Value="Public Sub New ()" />
<MemberSignature Language="C++ CLI" Value="public:
 LoginName();" />
<MemberType>Constructor</MemberType>
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute FrameworkAlternate="netframework-4.0">
<AttributeName Language="C#">[System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")]</AttributeName>
<AttributeName Language="F#">[<System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")>]</AttributeName>
</Attribute>
</Attributes>
<Parameters />
<Docs>
<summary>Initializes the <see cref="T:System.Web.UI.WebControls.LoginName" /> control to its default values.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
Creates a new instance of the <xref:System.Web.UI.WebControls.LoginName> control.
]]></format>
</remarks>
<related type="Article" href="https://learn.microsoft.com/previous-versions/aspnet/ms178329(v=vs.100)">ASP.NET Login Controls Overview</related>
</Docs>
</Member>
<Member MemberName="FormatString">
<MemberSignature Language="C#" Value="public virtual string FormatString { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance string FormatString" />
<MemberSignature Language="DocId" Value="P:System.Web.UI.WebControls.LoginName.FormatString" />
<MemberSignature Language="VB.NET" Value="Public Overridable Property FormatString As String" />
<MemberSignature Language="F#" Value="member this.FormatString : string with get, set" Usage="System.Web.UI.WebControls.LoginName.FormatString" />
<MemberSignature Language="C++ CLI" Value="public:
 virtual property System::String ^ FormatString { System::String ^ get(); void set(System::String ^ value); };" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute>
<AttributeName Language="C#">[System.ComponentModel.DefaultValue("{0}")]</AttributeName>
<AttributeName Language="F#">[<System.ComponentModel.DefaultValue("{0}")>]</AttributeName>
</Attribute>
<Attribute>
<AttributeName Language="C#">[System.ComponentModel.Localizable(true)]</AttributeName>
<AttributeName Language="F#">[<System.ComponentModel.Localizable(true)>]</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.String</ReturnType>
</ReturnValue>
<Docs>
<summary>Provides a format item string to display.</summary>
<value>A string containing format items for displaying the user's name. The default value is "{0}".</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.Web.UI.WebControls.LoginName.FormatString%2A> 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.|
|<xref:System.String.Empty>|Same as default. To hide the control, set the <xref:System.Web.UI.Control.Visible%2A> 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 <xref:System.Web.UI.WebControls.LoginName.FormatString%2A> 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 <xref:System.ComponentModel.LocalizableAttribute> and [Globalization and Localization](https://learn.microsoft.com/previous-versions/aspnet/c6zyy3s9(v=vs.100)).
## Examples
The following code example shows how to use the <xref:System.Web.UI.WebControls.LoginName.FormatString%2A> property on a page. Clicking the button changes the display format.
:::code language="aspx-csharp" source="~/snippets/csharp/VS_Snippets_WebNet/LoginNameTextFormat/CS/loginnametextformatcs.aspx" id="Snippet1":::
:::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/LoginNameTextFormat/VB/loginnametextformatvb.aspx" id="Snippet1":::
]]></format>
</remarks>
<exception cref="T:System.FormatException">The format string is not valid.</exception>
<related type="Article" href="https://learn.microsoft.com/previous-versions/aspnet/ms178329(v=vs.100)">ASP.NET Login Controls Overview</related>
</Docs>
</Member>
<Member MemberName="Render">
<MemberSignature Language="C#" Value="protected internal override void Render (System.Web.UI.HtmlTextWriter writer);" />
<MemberSignature Language="ILAsm" Value=".method familyorassemblyhidebysig virtual instance void Render(class System.Web.UI.HtmlTextWriter writer) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Web.UI.WebControls.LoginName.Render(System.Web.UI.HtmlTextWriter)" />
<MemberSignature Language="VB.NET" Value="Protected Friend Overrides Sub Render (writer As HtmlTextWriter)" />
<MemberSignature Language="F#" Value="override this.Render : System.Web.UI.HtmlTextWriter -> unit" Usage="loginName.Render writer" />
<MemberSignature Language="C++ CLI" Value="protected public:
 override void Render(System::Web::UI::HtmlTextWriter ^ writer);" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="writer" Type="System.Web.UI.HtmlTextWriter" />
</Parameters>
<Docs>
<param name="writer">The <see cref="T:System.Web.UI.HtmlTextWriter" /> that receives the rendered output.</param>
<summary>Renders the <see cref="T:System.Web.UI.WebControls.LoginName" /> control to the specified <see cref="T:System.Web.UI.HtmlTextWriter" /> control.</summary>
<remarks>To be added.</remarks>
</Docs>
</Member>
<Member MemberName="RenderBeginTag">
<MemberSignature Language="C#" Value="public override void RenderBeginTag (System.Web.UI.HtmlTextWriter writer);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig virtual instance void RenderBeginTag(class System.Web.UI.HtmlTextWriter writer) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Web.UI.WebControls.LoginName.RenderBeginTag(System.Web.UI.HtmlTextWriter)" />
<MemberSignature Language="VB.NET" Value="Public Overrides Sub RenderBeginTag (writer As HtmlTextWriter)" />
<MemberSignature Language="F#" Value="override this.RenderBeginTag : System.Web.UI.HtmlTextWriter -> unit" Usage="loginName.RenderBeginTag writer" />
<MemberSignature Language="C++ CLI" Value="public:
 override void RenderBeginTag(System::Web::UI::HtmlTextWriter ^ writer);" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="writer" Type="System.Web.UI.HtmlTextWriter" />
</Parameters>
<Docs>
<param name="writer">A <see cref="T:System.Web.UI.HtmlTextWriter" /> object that represents the output stream that renders HTML content to the client.</param>
<summary>Renders the HTML opening tag of the control to the specified writer.</summary>
<remarks>To be added.</remarks>
</Docs>
</Member>
<Member MemberName="RenderContents">
<MemberSignature Language="C#" Value="protected internal override void RenderContents (System.Web.UI.HtmlTextWriter writer);" />
<MemberSignature Language="ILAsm" Value=".method familyorassemblyhidebysig virtual instance void RenderContents(class System.Web.UI.HtmlTextWriter writer) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Web.UI.WebControls.LoginName.RenderContents(System.Web.UI.HtmlTextWriter)" />
<MemberSignature Language="VB.NET" Value="Protected Friend Overrides Sub RenderContents (writer As HtmlTextWriter)" />
<MemberSignature Language="F#" Value="override this.RenderContents : System.Web.UI.HtmlTextWriter -> unit" Usage="loginName.RenderContents writer" />
<MemberSignature Language="C++ CLI" Value="protected public:
 override void RenderContents(System::Web::UI::HtmlTextWriter ^ writer);" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="writer" Type="System.Web.UI.HtmlTextWriter" />
</Parameters>
<Docs>
<param name="writer">A <see cref="T:System.Web.UI.HtmlTextWriter" /> object that represents the output stream that renders HTML content to the client.</param>
<summary>Renders the contents of the control to the specified writer. This method is used primarily by control developers.</summary>
<remarks>To be added.</remarks>
<exception cref="T:System.FormatException">The <see cref="P:System.Web.UI.WebControls.LoginName.FormatString" /> property is not set to a valid format string.</exception>
</Docs>
</Member>
<Member MemberName="RenderEndTag">
<MemberSignature Language="C#" Value="public override void RenderEndTag (System.Web.UI.HtmlTextWriter writer);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig virtual instance void RenderEndTag(class System.Web.UI.HtmlTextWriter writer) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Web.UI.WebControls.LoginName.RenderEndTag(System.Web.UI.HtmlTextWriter)" />
<MemberSignature Language="VB.NET" Value="Public Overrides Sub RenderEndTag (writer As HtmlTextWriter)" />
<MemberSignature Language="F#" Value="override this.RenderEndTag : System.Web.UI.HtmlTextWriter -> unit" Usage="loginName.RenderEndTag writer" />
<MemberSignature Language="C++ CLI" Value="public:
 override void RenderEndTag(System::Web::UI::HtmlTextWriter ^ writer);" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="writer" Type="System.Web.UI.HtmlTextWriter" />
</Parameters>
<Docs>
<param name="writer">A <see cref="T:System.Web.UI.HtmlTextWriter" /> object that represents the output stream that renders HTML content to the client.</param>
<summary>Renders the HTML closing tag of the control to the specified writer.</summary>
<remarks>To be added.</remarks>
</Docs>
</Member>
<Member MemberName="SupportsDisabledAttribute">
<MemberSignature Language="C#" Value="public override bool SupportsDisabledAttribute { get; }" />
<MemberSignature Language="ILAsm" Value=".property instance bool SupportsDisabledAttribute" />
<MemberSignature Language="DocId" Value="P:System.Web.UI.WebControls.LoginName.SupportsDisabledAttribute" />
<MemberSignature Language="VB.NET" Value="Public Overrides ReadOnly Property SupportsDisabledAttribute As Boolean" />
<MemberSignature Language="F#" Value="member this.SupportsDisabledAttribute : bool" Usage="System.Web.UI.WebControls.LoginName.SupportsDisabledAttribute" />
<MemberSignature Language="C++ CLI" Value="public:
 virtual property bool SupportsDisabledAttribute { bool get(); };" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Boolean</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets a value that indicates whether the control should set the <see langword="disabled" /> attribute of the rendered HTML element to "disabled" when the control's <see cref="P:System.Web.UI.WebControls.WebControl.IsEnabled" /> property is <see langword="false" />.</summary>
<value>
<see langword="true" /> if the <see cref="P:System.Web.UI.Control.RenderingCompatibility" /> property indicates an ASP.NET version lower than <c>4.0</c>; otherwise, <see langword="false" />.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
This property indicates how ASP.NET should render HTML for a control when the control is disabled. If this property is `true`, ASP.NET renders a `disabled` attribute when a control is disabled. If this property is `false`, ASP.NET renders a `class` attribute when a control is disabled. For more information, see <xref:System.Web.UI.WebControls.WebControl.SupportsDisabledAttribute%2A?displayProperty=nameWithType>.
]]></format>
</remarks>
<altmember cref="P:System.Web.UI.Control.RenderingCompatibility" />
<altmember cref="P:System.Web.UI.WebControls.WebControl.DisabledCssClass" />
<altmember cref="P:System.Web.UI.WebControls.WebControl.SupportsDisabledAttribute" />
<related type="Article" href="https://learn.microsoft.com/previous-versions/aspnet/ms178329(v=vs.100)">ASP.NET Login Controls Overview</related>
</Docs>
</Member>
</Members>
</Type>