///////////////////////////////////////////////////////////////////////// // PAGINATION SUPPORT ///////////////////////////////////////////////////////////////////////// /// <include file='doc\XhtmlBasicFormAdapter.uex' path='docs/doc[@for="XhtmlFormAdapter.RenderPager"]/*' /> protected virtual void RenderPager(XhtmlMobileTextWriter writer) { PagerStyle pagerStyle = Control.PagerStyle; int pageCount = Control.PageCount; if (pageCount <= 1) { return; } int page = Control.CurrentPage; String text = pagerStyle.GetPageLabelText(page, pageCount); if ((page > 1) || (text.Length > 0) || (page < pageCount)) { writer.WritePendingBreak(); ConditionalEnterStyle(writer, pagerStyle); ConditionalEnterPagerSpan(writer); } if (page > 1) { RenderPagerTag(writer, page - 1, pagerStyle.GetPreviousPageText(page), XhtmlConstants.PagerPreviousAccessKeyCustomAttribute); writer.Write(" "); } if (text.Length > 0) { writer.WriteEncodedText(text); writer.Write(" "); } if (page < pageCount) { RenderPagerTag(writer, page + 1, pagerStyle.GetNextPageText(page), XhtmlConstants.PagerNextAccessKeyCustomAttribute); } if ((page > 1) || (text.Length > 0) || (page < pageCount)) { ConditionalExitPagerSpan(writer); ConditionalExitStyle(writer, pagerStyle); writer.SetPendingBreak(); } }
/// <include file='doc\HtmlFormAdapter.uex' path='docs/doc[@for="HtmlFormAdapter.RenderPager"]/*' /> protected virtual void RenderPager(HtmlMobileTextWriter writer) { if (!_renderPager) { return; } PagerStyle pagerStyle = Control.PagerStyle; int pageCount = Control.PageCount; if (pageCount <= 1) { return; } int page = Control.CurrentPage; String text = pagerStyle.GetPageLabelText(page, pageCount); if ((page > 1) || (text.Length > 0) || (page < pageCount)) { writer.EnterStyle(pagerStyle); } if (page > 1) { RenderPagerTag(writer, page - 1, pagerStyle.GetPreviousPageText(page)); writer.Write(" "); } if (text.Length > 0) { writer.WriteEncodedText(text); writer.Write(" "); } if (page < pageCount) { RenderPagerTag(writer, page + 1, pagerStyle.GetNextPageText(page)); } if ((page > 1) || (text.Length > 0) || (page < pageCount)) { writer.ExitStyle(pagerStyle, true); } }
protected virtual void RenderPager(WmlMobileTextWriter writer) { PagerStyle pagerStyle = Control.PagerStyle; int pageCount = Control.PageCount; if (pageCount <= 1) { return; } int page = Control.CurrentPage; writer.EnterStyle(pagerStyle); if (page < pageCount) { String nextPageText = pagerStyle.GetNextPageText(page); RenderPostBackEvent(writer, (page + 1).ToString(), writer.IsValidSoftkeyLabel(nextPageText) ? nextPageText : GetDefaultLabel(NextLabel), true, nextPageText, true); } if (page > 1) { String prevPageText = pagerStyle.GetPreviousPageText(page); RenderPostBackEvent(writer, (page - 1).ToString(), writer.IsValidSoftkeyLabel(prevPageText) ? prevPageText : GetDefaultLabel(PreviousLabel), true, prevPageText, true); } writer.ExitStyle(pagerStyle); }