ASPxClientWebDocumentViewer.GetCurrentPageIndex() Method

Returns the current page's zero-based index.

Namespace: DevExpress.XtraReports.Web.Scripts

Assembly: DevExpress.XtraReports.v18.1.Web.Scripts.dll

Syntax

public int GetCurrentPageIndex()

Returns

Type Description
Int32

A zero-based integer value that specifies the index of a current page.

The code snippet below demonstrates how to use the ASPxClientWebDocumentViewer.DocumentReady event to navigate through pages of a ready document. To obtain the current page number and navigate to the next page, use the GetCurrentPageIndex and ASPxClientWebDocumentViewer.GoToPage methods.

<script type="text/javascript" id="script">
    function documentReady(s, e) {
        var goToNextPage = function () {
            var pageIndex = s.GetCurrentPageIndex();
            if (e.PageCount <= pageIndex)
                return;
            s.GoToPage(pageIndex + 1);
            setTimeout(function () { goToNextPage(); }, 3000);
        }
        goToNextPage();
    }
</script>

<dx:ASPxWebDocumentViewer ID="ASPxWebDocumentViewer1" runat="server" ReportSourceId="WebReportDesigner.XtraReport1">
     <ClientSideEvents DocumentReady="documentReady"/>
</dx:ASPxWebDocumentViewer>

See Also