How to: Add and Configure a Label Control

Use the Label control to display short, output-only text strings.

To add a Label control to an ASP.NET mobile Web Forms page

  1. Drag a Label control from theMobile Web Forms tab of the Toolbox onto a Form or Panel control, or inside a control's template on a mobile Web Forms page. You can also drag it onto a mobile user control page.

  2. In the Properties window, type the text that you want for the label in the Text property.

  3. Optionally format the appearance of the label by using the Properties window:

    1. Set the text color with the ForeColor property.

    2. Define the text alignment by setting the Alignment property to Left, Center, or Right.

    3. Specify the font by using the Font property.

    4. Set the text's style with the StyleReference property.

    5. Enable or disable text wrapping by using the Wrapping property.

    6. Prevent a line feed after the Label control by setting the BreakAfter property to false.

    7. Apply device filters with the AppliedDeviceFilters collection. You can also override properties for the Label control.

See Also

Reference

System.Web.UI.MobileControls.Label

Concepts

Introduction to the Label Control

Overriding Properties

Other Resources

Using Device Filters