Compartilhar via


Creating Custom Mobile Controls

You can create two types of mobile controls, mobile user controls and custom mobile controls. User controls are created using an .ascx file and inherit from MobileUserControl. Custom mobile controls are self-contained objects that inherit from System.Web.UI.MobileControls.MobileControl. Creating ASP.NET mobile user controls and custom mobile controls offers you a way to reuse common user interface (UI) functionality across your ASP.NET mobile Web pages.

ASP.NET provides several techniques for writing your own mobile controls. To help determine which type of control is most appropriate for your application, see ASP.NET User Controls Overview and Developing Custom ASP.NET Server Controls.

With ASP.NET mobile user controls, as in standard ASP.NET user controls, you can use fragment caching — a technique that allows you to cache output from a control independently from the rest of the Web page containing the control. For information about caching output from ASP.NET user controls, see Caching Portions of an ASP.NET Page.

When you create ASP.NET mobile Web pages, you must choose a single language, such as Microsoft Visual Basic or C#. However, a single mobile Web page can include user controls and custom controls authored in any language supported by the common language runtime.

In This Section

See Also

Reference

MobileControl

Concepts

ASP.NET User Controls Overview

Other Resources

Extensibility Developer's Guide

Developing Custom ASP.NET Server Controls