1<?xml version="1.0" encoding="utf-8"?>
2<Type Name="Label" FullName="System.Web.UI.WebControls.Label">
3  <TypeSignature Language="C#" Maintainer="auto" Value="public class Label : System.Web.UI.WebControls.WebControl, System.Web.UI.ITextControl" />
4  <AssemblyInfo>
5    <AssemblyName>System.Web</AssemblyName>
6    <AssemblyPublicKey>
7    </AssemblyPublicKey>
8    <AssemblyVersion>1.0.5000.0</AssemblyVersion>
9    <AssemblyVersion>2.0.0.0</AssemblyVersion>
10  </AssemblyInfo>
11  <ThreadSafetyStatement>Gtk# is thread aware, but not thread safe; See the &lt;link location="node:gtk-sharp/programming/threads"&gt;Gtk# Thread Programming&lt;/link&gt; for details.</ThreadSafetyStatement>
12  <Base>
13    <BaseTypeName>System.Web.UI.WebControls.WebControl</BaseTypeName>
14  </Base>
15  <Interfaces>
16    <Interface>
17      <InterfaceName>System.Web.UI.ITextControl</InterfaceName>
18    </Interface>
19  </Interfaces>
20  <Attributes>
21    <Attribute>
22      <AttributeName>System.Web.UI.ControlValueProperty("Text", null)</AttributeName>
23    </Attribute>
24    <Attribute>
25      <AttributeName>System.Web.UI.ToolboxData("&lt;{0}:Label runat="server" Text="Label"&gt;&lt;/{0}:Label&gt;")</AttributeName>
26    </Attribute>
27    <Attribute>
28      <AttributeName>System.Web.UI.ParseChildren(false)</AttributeName>
29    </Attribute>
30    <Attribute>
31      <AttributeName>System.ComponentModel.Designer("System.Web.UI.Design.WebControls.LabelDesigner, System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", "System.ComponentModel.Design.IDesigner")</AttributeName>
32    </Attribute>
33    <Attribute>
34      <AttributeName>System.ComponentModel.DefaultProperty("Text")</AttributeName>
35    </Attribute>
36    <Attribute>
37      <AttributeName>System.Web.UI.DataBindingHandler("System.Web.UI.Design.TextDataBindingHandler, System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")</AttributeName>
38    </Attribute>
39    <Attribute>
40      <AttributeName>System.Web.UI.ControlBuilder(typeof(System.Web.UI.WebControls.LabelControlBuilder))</AttributeName>
41    </Attribute>
42  </Attributes>
43  <Docs>
44    <remarks>
45      <attribution license="cc4" from="Microsoft" modified="false" />
46      <para>In this topic:</para>
47      <list type="bullet">
48        <item>
49          <para>
50            <format type="text/html">
51              <a href="#introduction">Introduction</a>
52            </format>
53          </para>
54        </item>
55        <item>
56          <para>
57            <format type="text/html">
58              <a href="#accessibility">Accessibility</a>
59            </format>
60          </para>
61        </item>
62        <item>
63          <para>
64            <format type="text/html">
65              <a href="#declarative_syntax">Declarative Syntax</a>
66            </format>
67          </para>
68        </item>
69      </list>
70      <format type="text/html">
71        <a href="#introduction" />
72      </format>
73      <format type="text/html">
74        <h2>Introduction</h2>
75      </format>
76      <para>Use the <see cref="T:System.Web.UI.WebControls.Label" /> control to display text in a set location on the page. Unlike static text, you can customize the displayed text through the <see cref="P:System.Web.UI.WebControls.Label.Text" /> property.</para>
77      <para>You can also use the <see cref="T:System.Web.UI.WebControls.Literal" /> and <see cref="T:System.Web.UI.WebControls.PlaceHolder" /> controls to display text on the Web Forms page. However, unlike the <see cref="T:System.Web.UI.WebControls.Label" /> control, these controls do not render any additional tags.</para>
78      <block subset="none" type="note">
79        <para>This control can be used to display user input, which is a potential security threat. By default, ASP.NET Web pages validate that user input does not include script or HTML elements. For more information, see <format type="text/html"><a href="772c7312-211a-4eb3-8d6e-eec0aa1dcc07">Script Exploits Overview</a></format>.</para>
80      </block>
81      <format type="text/html">
82        <a href="#accessibility" />
83      </format>
84      <format type="text/html">
85        <h2>Accessibility</h2>
86      </format>
87      <para>For information about how to configure this control so that it generates markup that conforms to accessibility standards, see <format type="text/html"><a href="7e3ce9c4-6b7d-4fb1-94b5-72cf2a44fe13">Accessibility in Visual Studio 2010 and ASP.NET 4</a></format> and <format type="text/html"><a href="847a37e3-ce20-41da-b0d3-7dfb0fdae9a0">ASP.NET Controls and Accessibility</a></format>.</para>
88      <format type="text/html">
89        <a href="#declarative_syntax" />
90      </format>
91      <format type="text/html">
92        <h2>Declarative Syntax</h2>
93      </format>
94      <code>&lt;asp:Label
95    AccessKey="string"
96    AssociatedControlID="string"
97    BackColor="color name|#dddddd"
98    BorderColor="color name|#dddddd"
99    BorderStyle="<codeFeaturedElement>NotSet</codeFeaturedElement>|None|Dotted|Dashed|Solid|Double|Groove|Ridge|
100        Inset|Outset"
101    BorderWidth="size"
102    CssClass="string"
103    Enabled="<codeFeaturedElement>True</codeFeaturedElement>|False"
104    EnableTheming="<codeFeaturedElement>True</codeFeaturedElement>|False"
105    EnableViewState="<codeFeaturedElement>True</codeFeaturedElement>|False"
106    Font-Bold="True|<codeFeaturedElement>False</codeFeaturedElement>"
107    Font-Italic="True|<codeFeaturedElement>False</codeFeaturedElement>"
108    Font-Names="string"
109    Font-Overline="True|<codeFeaturedElement>False</codeFeaturedElement>"
110    Font-Size="string|Smaller|Larger|XX-Small|X-Small|Small|Medium|
111        Large|X-Large|XX-Large"
112    Font-Strikeout="True|<codeFeaturedElement>False</codeFeaturedElement>"
113    Font-Underline="True|<codeFeaturedElement>False</codeFeaturedElement>"
114    ForeColor="color name|#dddddd"
115    Height="size"
116    ID="string"
117    OnDataBinding="DataBinding event handler"
118    OnDisposed="Disposed event handler"
119    OnInit="Init event handler"
120    OnLoad="Load event handler"
121    OnPreRender="PreRender event handler"
122    OnUnload="Unload event handler"
123    runat="server"
124    SkinID="string"
125    Style="string"
126    TabIndex="integer"
127    Text="string"
128    ToolTip="string"
129    Visible="<codeFeaturedElement>True</codeFeaturedElement>|False"
130    Width="size"
131/&gt;</code>
132    </remarks>
133    <summary>
134      <attribution license="cc4" from="Microsoft" modified="false" />
135      <para>Represents a label control, which displays text on a Web page.</para>
136    </summary>
137  </Docs>
138  <Members>
139    <Member MemberName=".ctor">
140      <MemberSignature Language="C#" Value="public Label ();" />
141      <MemberType>Constructor</MemberType>
142      <ReturnValue />
143      <Parameters />
144      <Docs>
145        <remarks>
146          <attribution license="cc4" from="Microsoft" modified="false" />
147          <para>Use this constructor to create and initialize a new instance of the <see cref="T:System.Web.UI.WebControls.Label" /> class.</para>
148        </remarks>
149        <summary>
150          <attribution license="cc4" from="Microsoft" modified="false" />
151          <para>Initializes a new instance of the <see cref="T:System.Web.UI.WebControls.Label" /> class.</para>
152        </summary>
153      </Docs>
154      <AssemblyInfo>
155        <AssemblyVersion>1.0.5000.0</AssemblyVersion>
156        <AssemblyVersion>2.0.0.0</AssemblyVersion>
157      </AssemblyInfo>
158    </Member>
159    <Member MemberName="AddAttributesToRender">
160      <MemberSignature Language="C#" Value="protected override void AddAttributesToRender (System.Web.UI.HtmlTextWriter writer);" />
161      <MemberType>Method</MemberType>
162      <AssemblyInfo>
163        <AssemblyVersion>1.0.5000.0</AssemblyVersion>
164        <AssemblyVersion>2.0.0.0</AssemblyVersion>
165      </AssemblyInfo>
166      <ReturnValue>
167        <ReturnType>System.Void</ReturnType>
168      </ReturnValue>
169      <Parameters>
170        <Parameter Name="writer" Type="System.Web.UI.HtmlTextWriter" />
171      </Parameters>
172      <Docs>
173        <remarks>
174          <attribution license="cc4" from="Microsoft" modified="false" />
175          <para>The <see cref="M:System.Web.UI.WebControls.Label.AddAttributesToRender(System.Web.UI.HtmlTextWriter)" /> method is used primarily by control developers to insert the additional attributes and styles to the <see cref="T:System.Web.UI.HtmlTextWriter" /> output stream for a <see cref="T:System.Web.UI.WebControls.Label" /> control.</para>
176          <para>The <see cref="M:System.Web.UI.WebControls.Label.AddAttributesToRender(System.Web.UI.HtmlTextWriter)" /> method for a <see cref="T:System.Web.UI.WebControls.Label" /> control determines whether the for attribute should be added with the <see cref="P:System.Web.UI.WebControls.Label.AssociatedControlID" /> value, and if the inline-block style should be applied to display the border style and width.</para>
177        </remarks>
178        <summary>
179          <attribution license="cc4" from="Microsoft" modified="false" />
180          <para>Adds the HTML attributes and styles of a <see cref="T:System.Web.UI.WebControls.Label" /> control to render to the specified output stream. </para>
181        </summary>
182        <param name="writer">
183          <attribution license="cc4" from="Microsoft" modified="false" />An <see cref="T:System.Web.UI.HtmlTextWriter" /> that represents the output stream to render HTML content on the client.</param>
184      </Docs>
185    </Member>
186    <Member MemberName="AddParsedSubObject">
187      <MemberSignature Language="C#" Value="protected override void AddParsedSubObject (object obj);" />
188      <MemberType>Method</MemberType>
189      <ReturnValue>
190        <ReturnType>System.Void</ReturnType>
191      </ReturnValue>
192      <Parameters>
193        <Parameter Name="obj" Type="System.Object" />
194      </Parameters>
195      <Docs>
196        <remarks>
197          <attribution license="cc4" from="Microsoft" modified="false" />
198          <para>The <see cref="M:System.Web.UI.WebControls.Label.AddParsedSubObject(System.Object)" /> method is used primarily by control developers when deriving a custom control from the <see cref="T:System.Web.UI.WebControls.Label" /> class.</para>
199          <para>If the input object is a <see cref="T:System.Web.UI.LiteralControl" />, and the <see cref="T:System.Web.UI.WebControls.Label" /> control has no child controls, the input object is used to set the <see cref="P:System.Web.UI.WebControls.Label.Text" /> property of the <see cref="T:System.Web.UI.WebControls.Label" /> control. Otherwise, the <see cref="M:System.Web.UI.Control.AddParsedSubObject(System.Object)" /> method of the base <see cref="T:System.Web.UI.Control" /> class is called and the specified object is added to the <see cref="P:System.Web.UI.Control.Controls" /> collection.</para>
200        </remarks>
201        <summary>
202          <attribution license="cc4" from="Microsoft" modified="false" />
203          <para>Notifies the control that an element was parsed and adds the element to the <see cref="T:System.Web.UI.WebControls.Label" /> control.</para>
204        </summary>
205        <param name="obj">
206          <attribution license="cc4" from="Microsoft" modified="false" />An object that represents the parsed element.</param>
207      </Docs>
208      <AssemblyInfo>
209        <AssemblyVersion>1.0.5000.0</AssemblyVersion>
210        <AssemblyVersion>2.0.0.0</AssemblyVersion>
211      </AssemblyInfo>
212    </Member>
213    <Member MemberName="AssociatedControlID">
214      <MemberSignature Language="C#" Value="public virtual string AssociatedControlID { set; get; }" />
215      <MemberType>Property</MemberType>
216      <AssemblyInfo>
217        <AssemblyVersion>1.0.5000.0</AssemblyVersion>
218        <AssemblyVersion>2.0.0.0</AssemblyVersion>
219      </AssemblyInfo>
220      <Attributes>
221        <Attribute>
222          <AttributeName>System.ComponentModel.DefaultValue("")</AttributeName>
223        </Attribute>
224        <Attribute>
225          <AttributeName>System.Web.UI.Themeable(false)</AttributeName>
226        </Attribute>
227        <Attribute>
228          <AttributeName>System.ComponentModel.TypeConverter(typeof(System.Web.UI.WebControls.AssociatedControlConverter))</AttributeName>
229        </Attribute>
230        <Attribute>
231          <AttributeName>System.Web.UI.IDReferenceProperty(typeof(System.Web.UI.Control))</AttributeName>
232        </Attribute>
233      </Attributes>
234      <ReturnValue>
235        <ReturnType>System.String</ReturnType>
236      </ReturnValue>
237      <Docs>
238        <value>To be added.</value>
239        <remarks>
240          <attribution license="cc4" from="Microsoft" modified="false" />
241          <para>Use the <see cref="P:System.Web.UI.WebControls.Label.AssociatedControlID" /> property to associate a <see cref="T:System.Web.UI.WebControls.Label" /> control with another server control on a Web form. When a <see cref="T:System.Web.UI.WebControls.Label" /> control is associated with another server control, its attributes can be used to extend the functionality of the associated control. You can use the <see cref="T:System.Web.UI.WebControls.Label" /> control as a caption for another control, or you can set the tab index or hot key for an associated control.</para>
242          <para>When the <see cref="P:System.Web.UI.WebControls.Label.AssociatedControlID" /> property is set, the <see cref="T:System.Web.UI.WebControls.Label" /> control renders as an HTML label element, with the for attribute set to the <see cref="P:System.Web.UI.Control.ID" /> property of the associated control. You can set other attributes of the label element using the <see cref="T:System.Web.UI.WebControls.Label" /> properties. For example, you can use the <see cref="P:System.Web.UI.WebControls.Label.Text" /> and <see cref="P:System.Web.UI.WebControls.WebControl.AccessKey" /> properties to provide the caption and hot key for an associated control.</para>
243          <para>This property cannot be set by themes or style sheet themes. For more information, see <see cref="T:System.Web.UI.ThemeableAttribute" /> and <format type="text/html"><a href="5df3ebbd-d46c-4502-9406-02f9df4ef2c3">ASP.NET Themes Overview</a></format>.</para>
244        </remarks>
245        <summary>
246          <attribution license="cc4" from="Microsoft" modified="false" />
247          <para>Gets or sets the identifier for a server control that the <see cref="T:System.Web.UI.WebControls.Label" /> control is associated with.</para>
248        </summary>
249      </Docs>
250    </Member>
251    <Member MemberName="LoadViewState">
252      <MemberSignature Language="C#" Value="protected override void LoadViewState (object savedState);" />
253      <MemberType>Method</MemberType>
254      <ReturnValue>
255        <ReturnType>System.Void</ReturnType>
256      </ReturnValue>
257      <Parameters>
258        <Parameter Name="savedState" Type="System.Object" />
259      </Parameters>
260      <Docs>
261        <remarks>
262          <attribution license="cc4" from="Microsoft" modified="false" />
263          <para>This method is used primarily by the .NET Framework infrastructure and is not intended to be used directly from your code. However, control developers can override this method to specify how a custom server control restores its view state. For more information, see <format type="text/html"><a href="0218d965-5d30-445b-b6a6-8870e70e63ce">ASP.NET State Management Overview</a></format>.</para>
264          <para>The <see cref="M:System.Web.UI.WebControls.Label.LoadViewState(System.Object)" /> method restores view-state information for the <see cref="T:System.Web.UI.WebControls.Label" /> control from a previous page request that was saved by the <see cref="M:System.Web.UI.WebControls.WebControl.SaveViewState" /> method.</para>
265        </remarks>
266        <summary>
267          <attribution license="cc4" from="Microsoft" modified="false" />
268          <para>Loads the previously saved state for the control. </para>
269        </summary>
270        <param name="savedState">
271          <attribution license="cc4" from="Microsoft" modified="false" />An object that contains the saved view state values for the control. </param>
272      </Docs>
273      <AssemblyInfo>
274        <AssemblyVersion>1.0.5000.0</AssemblyVersion>
275        <AssemblyVersion>2.0.0.0</AssemblyVersion>
276      </AssemblyInfo>
277    </Member>
278    <Member MemberName="RenderContents">
279      <MemberSignature Language="C#" Value="protected override void RenderContents (System.Web.UI.HtmlTextWriter writer);" />
280      <MemberType>Method</MemberType>
281      <ReturnValue>
282        <ReturnType>System.Void</ReturnType>
283      </ReturnValue>
284      <Parameters>
285        <Parameter Name="writer" Type="System.Web.UI.HtmlTextWriter" />
286      </Parameters>
287      <Docs>
288        <remarks>To be added</remarks>
289        <summary>
290          <attribution license="cc4" from="Microsoft" modified="false" />
291          <para>Renders the contents of the <see cref="T:System.Web.UI.WebControls.Label" /> into the specified writer.</para>
292        </summary>
293        <param name="writer">
294          <attribution license="cc4" from="Microsoft" modified="false" />The output stream that renders HTML content to the client. </param>
295      </Docs>
296      <AssemblyInfo>
297        <AssemblyVersion>1.0.5000.0</AssemblyVersion>
298        <AssemblyVersion>2.0.0.0</AssemblyVersion>
299      </AssemblyInfo>
300    </Member>
301    <Member MemberName="TagKey">
302      <MemberSignature Language="C#" Value="protected override System.Web.UI.HtmlTextWriterTag TagKey { get; }" />
303      <MemberType>Property</MemberType>
304      <AssemblyInfo>
305        <AssemblyVersion>1.0.5000.0</AssemblyVersion>
306        <AssemblyVersion>2.0.0.0</AssemblyVersion>
307      </AssemblyInfo>
308      <ReturnValue>
309        <ReturnType>System.Web.UI.HtmlTextWriterTag</ReturnType>
310      </ReturnValue>
311      <Docs>
312        <value>To be added.</value>
313        <remarks>
314          <attribution license="cc4" from="Microsoft" modified="false" />
315          <para>Use the <see cref="P:System.Web.UI.WebControls.Label.TagKey" /> property to determine the <see cref="T:System.Web.UI.HtmlTextWriterTag" /> value that is associated with a <see cref="T:System.Web.UI.WebControls.Label" /> control. The <see cref="P:System.Web.UI.WebControls.Label.TagKey" /> property is used primarily by control developers.</para>
316        </remarks>
317        <summary>
318          <attribution license="cc4" from="Microsoft" modified="false" />
319          <para>Gets the HTML tag that is used to render the <see cref="T:System.Web.UI.WebControls.Label" /> control.</para>
320        </summary>
321      </Docs>
322    </Member>
323    <Member MemberName="Text">
324      <MemberSignature Language="C#" Value="public virtual string Text { set; get; }" />
325      <MemberType>Property</MemberType>
326      <ReturnValue>
327        <ReturnType>System.String</ReturnType>
328      </ReturnValue>
329      <Parameters />
330      <Docs>
331        <value>The text displayed in the label.</value>
332        <remarks>
333          <attribution license="cc4" from="Microsoft" modified="false" />
334          <para>Use the <see cref="P:System.Web.UI.WebControls.Label.Text" /> property to specify or determine the text content of the <see cref="T:System.Web.UI.WebControls.Label" /> control. This property is commonly used to programmatically customize the text that is displayed in the <see cref="T:System.Web.UI.WebControls.Label" /> control. </para>
335          <para>The <see cref="P:System.Web.UI.WebControls.Label.Text" /> property can include HTML. If it does, the HTML will be passed unchanged to the browser, where is might be interpreted as markup and not as text. If you want the browser to display HTML markup as plain text, you can use the <see cref="M:System.Web.HttpServerUtility.HtmlEncode(System.String)" /> method, as shown in the example for the class overview. You can also use the <see cref="T:System.Web.UI.WebControls.Literal" /> control instead of the <see cref="T:System.Web.UI.WebControls.Label" /> control, and set the <see cref="P:System.Web.UI.WebControls.Literal.Mode" /> property to <see cref="F:System.Web.UI.WebControls.LiteralMode.Encode" />.</para>
336          <block subset="none" type="note">
337            <para>Setting the <see cref="P:System.Web.UI.WebControls.Label.Text" /> property will clear any other controls contained in the <see cref="T:System.Web.UI.WebControls.Label" /> control.</para>
338          </block>
339          <block subset="none" type="note">
340            <para>This control can be used to display user input, which is a potential security threat. By default, ASP.NET Web pages validate that user input does not include script or HTML elements. For more information, see <format type="text/html"><a href="772c7312-211a-4eb3-8d6e-eec0aa1dcc07">Script Exploits Overview</a></format>.</para>
341          </block>
342          <para>The value of this property, when set, can be saved automatically to a resource file by using a designer tool. For more information, see <see cref="T:System.ComponentModel.LocalizableAttribute" /> and <format type="text/html"><a href="8ef3838e-9d05-4236-9dd0-ceecff9df80d">ASP.NET Globalization and Localization</a></format>.</para>
343          <para>This property is the default property that a <see cref="T:System.Web.UI.WebControls.ControlParameter" /> object binds to at run time. For more information, see <see cref="T:System.Web.UI.ControlValuePropertyAttribute" />, <see cref="T:System.Web.UI.WebControls.ControlParameter" />, and <format type="text/html"><a href="88622d04-2989-484e-93fe-594cd98dcf5f">Using Parameters with Data Source Controls</a></format>.</para>
344        </remarks>
345        <summary>
346          <attribution license="cc4" from="Microsoft" modified="false" />
347          <para>Gets or sets the text content of the <see cref="T:System.Web.UI.WebControls.Label" /> control.</para>
348        </summary>
349      </Docs>
350      <AssemblyInfo>
351        <AssemblyVersion>1.0.5000.0</AssemblyVersion>
352        <AssemblyVersion>2.0.0.0</AssemblyVersion>
353      </AssemblyInfo>
354      <Attributes>
355        <Attribute>
356          <AttributeName>System.ComponentModel.Localizable(true)</AttributeName>
357        </Attribute>
358        <Attribute>
359          <AttributeName>System.Web.UI.PersistenceMode(System.Web.UI.PersistenceMode.InnerDefaultProperty)</AttributeName>
360        </Attribute>
361        <Attribute>
362          <AttributeName>System.ComponentModel.DefaultValue("")</AttributeName>
363        </Attribute>
364        <Attribute>
365          <AttributeName>System.ComponentModel.Bindable(true)</AttributeName>
366        </Attribute>
367      </Attributes>
368    </Member>
369  </Members>
370</Type>