Using Labels in User Controls [AX 2012]
Updated: June 21, 2011
Applies To: Microsoft Dynamics AX 2012 R2, Microsoft Dynamics AX 2012 Feature Pack, Microsoft Dynamics AX 2012
When adding text that appears in User Controls, consider using labels so that the text can be more easily localized.
You can use labels from Microsoft Dynamics AX in the markup for a User Control. Add a Label control from the Toolbox to the layout. Set the Text property to the following value, substituting the number of the label that contains the text you want to display.
The text for the label will appear in the layout for the User Control. It will look like the following in the ASP.NET markup.
Labels from Microsoft Dynamics AX can also be used in code for a User Control. The Labels class in the Microsoft.Dynamics.Framework.Portal.UI namespace provides the GetLabel method. Use this method to retrieve a label value. For example, the following code uses a label to set the text for a button that was added to a User Control.