Creating an ASP.NET Mobile User Control
One type of programmer-defined control provided by the ASP.NET mobile controls is the mobile user control. Mobile user controls inherit from the base class in the namespace . These controls are stored in files with an .ascx extension.
Mobile user controls provide powerful techniques for extending the functionality of the ASP.NET mobile controls. For example, you can place nearly any control into a mobile user control. This includes both ASP.NET mobile controls and custom controls. You can even put acontrol into a mobile user control as a way of sharing styles among ASP.NET mobile Web pages. However, note that a control cannot be placed at the root level of a user control.
When defining a mobile user control, you can create it in Visual Studio and optionally store its code in a code-behind page. For more information, see Converting a Web Forms Page to a User Control and .
ASP.NET mobile controls enable you to develop mobile user controls in any .NET language such as Visual Basic or Visual C#. Use the following procedure to create mobile user controls in Visual Studio. The following procedure assumes that you have a Web application currently running in Visual Studio (Visual Web Developer). If you do not, begin by creating a new ASP.NET Web site in Visual Studio.
To create a mobile user control
In Solution Explorer, right-click the project name and then click Add New Item.
Under Visual Studio installed templates, select Mobile Web User Control, provide a name and select a language, and then click OK.
The designer displays a blank page.
Drag controls from the Toolbox and configure their properties as appropriate.
Add method and event handlers to the code-behind page, as needed.