Panel.Paginate 属性

定义

获取或设置指示是否对 Panel 控件进行分页的布尔值。 此 API 已废弃不用。 有关如何开发 ASP.NET 移动应用程序的信息,请参阅 移动应用 & 具有 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

属性值

如果对 Panel 进行分页,则为 true;否则为 false

属性

示例

下面的代码示例在对页面进行分页的设备上查看时,显示如何分页包含超出一页的控件的面板,以允许用户访问面板上的所有项。

注意

下面的代码示例使用单文件代码模型,如果直接复制到代码隐藏文件中,可能无法正常工作。 必须将此代码示例复制到扩展名为 .aspx 的空文本文件中。 有关详细信息,请参阅 ASP.NET Web Forms页代码模型

<%@ 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>

注解

Paginated 窗体分页发生后引发 事件。

注意

即使 属性 Paginate 设置为 false,如果设置了窗体的 ControlToPaginate 属性,仍可进行分页。

注意

若要允许在窗体内的控件中进行Panel分页,必须在窗体和面板中将 设置为 truePaginate

适用于

另请参阅