Preferred RenderingType : Mobile Capabilities « Mobile Control « ASP.Net






Preferred RenderingType

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="Paginate" %>
<%@ Register TagPrefix="mobile" Namespace="System.Web.UI.MobileControls" Assembly="System.Web.Mobile" %>
<%@ Import Namespace="System.Web.Mobile" %>

<html xmlns="http://www.w3.org/1999/xhtml" >
<body>
    <mobile:Form ID="Form1" runat="server" Paginate="True">
        Language is
        <mobile:Label runat="server" font-bold="true" id="theBrowser" />
        Item #1 <br />
        Item #2 <br />
        Item #3 <br />
        Item #4 <br />
        Item #5 <br />
        Item #6 <br />
        Item #7 <br />
        Item #8 <br />
        Item #9 <br />
        Item #10 <br />
        Item #11 <br />
        Item #12 <br />
    </mobile:Form>
</body>
</html>

File: Default.aspx.cs

using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.Mobile;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.MobileControls;
using System.Web.UI.WebControls;


public partial class Paginate : System.Web.UI.MobileControls.MobilePage
{
    protected void Page_Load(object sender, EventArgs e)
    {
        MobileCapabilities mobCaps = (MobileCapabilities)Request.Browser;
        theBrowser.Text = mobCaps.PreferredRenderingType;
    }
}

 








Related examples in the same category

1.Get mobile device information (VB.net)
2.Get mobile device code Capabilities (VB.net)
3.Get mobile device screen width and height (VB.net)
4.Mobile Capabilities: support color? (VB.net)
5.Mobile Capabilities