แก้ไข

แชร์ผ่าน


Panel.Paginate Property

Definition

Gets or sets a Boolean value indicating whether or not to paginate the Panel control. This API is obsolete. For information about how to develop ASP.NET mobile applications, see Mobile Apps & Sites with ASP.NET.

public:
 virtual property bool Paginate { bool get(); void set(bool value); };
[System.ComponentModel.Bindable(true)]
public virtual bool Paginate { get; set; }
[<System.ComponentModel.Bindable(true)>]
member this.Paginate : bool with get, set
Public Overridable Property Paginate As Boolean

Property Value

true to paginate the Panel; otherwise, false.

Attributes

Examples

The following code example, when viewed on a device that paginates the pages, shows how a panel containing more controls than will fit on one page is paginated to allow users access to all items on the panel.

Note

The following code sample uses the single-file code model and may not work correctly if copied directly into a code-behind file. This code sample must be copied into an empty text file that has an .aspx extension. For more information, see ASP.NET Web Forms Page Code Model.

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

<script runat="server">
    protected void Page_Load(object sender, EventArgs e)
    {
        System.Web.UI.MobileControls.Label lab;

        for (int i = 1; i < 16; i++)
        {
            lab = new System.Web.UI.MobileControls.Label();
            lab.Text = i.ToString() + 
                " - This sentence repeats over and over.";
            Panel1.Controls.Add(lab);
        }
        Form1.Paginate = true;
        Panel1.Paginate = true;
    }
</script>

<html xmlns="http://www.w3.org/1999/xhtml" >
<body>
    <mobile:form id="Form1" runat="server">
        <mobile:Panel ID="Panel1" Runat="server">
        </mobile:Panel>
    </mobile:form>
</body>
</html>
<%@ Page Language="VB" 
    Inherits="System.Web.UI.MobileControls.MobilePage" %>
<%@ Register TagPrefix="mobile" 
    Namespace="System.Web.UI.MobileControls" 
    Assembly="System.Web.Mobile" %>

<script runat="server">
    Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs)
        Dim lab As System.Web.UI.MobileControls.Label

        For i As Integer = 1 To 15
            lab = New System.Web.UI.MobileControls.Label()
            lab.Text = i.ToString() & _
                " - This sentence repeats over and over."
            Panel1.Controls.Add(lab)
        Next
        Form1.Paginate = True
        Panel1.Paginate = True
    End Sub
</script>

<html xmlns="http://www.w3.org/1999/xhtml" >
<body>
    <mobile:form id="Form1" runat="server">
        <mobile:Panel ID="Panel1" Runat="server">
        </mobile:Panel>
    </mobile:form>
</body>
</html>

Remarks

The Paginated event is raised after form pagination occurs.

Note

Even if the Paginate property is set to false, pagination can still occur if a form's ControlToPaginate property is set.

Note

To allow pagination in a Panel control within a form, you must set Paginate to true in both the form and the panel.

Applies to

See also