MobilePage Class
TOC
Collapse the table of content
Expand the table of content

MobilePage Class

.NET Framework 1.1

Serves as the base class for all ASP.NET mobile Web Forms pages.

public class System.Web.UI.MobileControls.MobilePage : 
   System.Web.UI.Page

Remarks

The MobilePage class itself inherits from the ASP.NET Page class. To specify a mobile page and use ASP.NET mobile controls, an ASP.NET mobile Web Forms page must contain the following page directive.

<%@ Page Inherits="System.Web.UI.MobileControls.MobilePage" Language="c#" %>

The Inherits attribute is required. The Language attribute is set to the language used on the page, if needed.

Example

This example demonstrates creating a mobile page and a form in an ASP.NET, and adding a label to the form. Note that the language attribute is not needed in this example because there is no code involved.

<%@ Page Inherits="System.Web.UI.MobileControls.MobilePage" %>
<%@ Register TagPrefix="mobile"
    Namespace="System.Web.UI.MobileControls"
    Assembly="System.Web.Mobile" %>

<mobile:Form runat="server">
  <mobile:Label runat="server">
    My First Label
  </mobile:Label>
</mobile:Form>

Requirements

Namespace: System.Web.UI.MobileControls

Assembly: System.Web.Mobile

See Also

MobilePage Control | Pages

Show:
© 2016 Microsoft