How to: Add Code to User Controls [AX 2012]
Updated: July 22, 2011
Applies To: Microsoft Dynamics AX 2012 R2, Microsoft Dynamics AX 2012 Feature Pack, Microsoft Dynamics AX 2012
You can add code to User Controls to enhance their functionality. Adding code to a User Control is like adding code to an ASP.NET control. For more information about how to write code for User Controls, see Coding User Controls.
To add code to a User Control
-
Start Visual Studio. If User Account Control (UAC) is active, be sure you start Visual Studio with administrative privileges.
-
Open the EP Web Application project that contains the User Control to which you want to add code. For information about how to create a project, see How to: Create an EP Web Application Project.
-
In Solution Explorer, right-click the User Control and then click View Code.
-
Make the necessary code additions and modifications.
-
Optionally, you can build the EP Web Application project to verify that there are no compiler errors in your code.
-
Save the changes for the User Control.