- <div>
- <et:dataview datasource="DbSrc1" pagesize="1">
- <table>
- <tr>
- <td>
- ID
- </td>
- <td>
- NAME
- </td>
- </tr>
- <et:it>
- <tr>
- <td>
- <et:datacolumn field="ID" /></td><td><et:datacolumn field="NAME" />
- </td>
- </tr>
- </et:it>
- </table>
- <div align="right">
- <table>
- <tr>
- <td><et:pager cssclass="the_pages" pagebuttoncount="8" showrecordcount="true" RecordCountFormat="共 <span id='sum' style='color:Red'>{0}</span> 页 "></et:pager></td>
- <td>
- <span class="num"> 到第</span>
- <input type="text" id="toPage" value="1" onkeypress='return changePage()' onmouseover='this.focus();' onfocus='this.select()'/>
- <span class="num"> 页</span>
- <input type="button" class="goButtonCss" value="跳转" onclick="GotoPage()"/>
- <script type="text/javascript">
- var param_page="<et:echo source='page' parameter='page'></et:echo>"; // 当前页码
- if(param_page!="")
- {
- document.getElementById('toPage').value = param_page;
- }
- function GotoPage()
- {
- var pg = document.getElementById('toPage').value; // 输入框的值
- var r = pg.match(/^[0-9]*[1-9][0-9]*$/); // 与正整数匹配
- if (null == r)
- {
- alert('请输入正整数');
- return false;
- }
- var maxPage = $("#sum").text().replace(/[^\x00-\xff]/g, ""); // 总页数
- if (parseInt(pg) >parseInt(maxPage))
- {
- alert('页码不得超过' + maxPage);
- }
- else
- {
- top.location.href = 'default.aspx?page=' + pg;
- }
- }
- function changePage()
- {
- try
- {
- if (window.event.keyCode == 13)
- {
- GotoPage();
- return false;
- }
- } catch (e) { }
- return true;
- }
- </script>
- </td>
- </tr>
- </table>
- </div>
- </et:dataview>
- </div>
- .the_pages{height:17px;font-family:arial,simSum;color:#FFA200;padding:10px 0}
- .the_pages a{display:block;float:left;width:auto;white-space:nowrap;text-align:center;border:1px solid #A5A5A5;line-height:18px;margin:0 2px;padding:2px 8px}
- .the_pages span{color:#FFA200;background:#fff;border-color:#666;padding:2px 8px}
- .the_pages a.linknow{border:1px solid #A5A5A5;background:#164a84;color:#fff}
- .the_pages a:hover{background:#FFA200;color:#fff;text-decoration:none}
- .the_pages input{height:17px;overflow:hidden;font-size:12px;margin:0 4px 0 0;padding:2px; vertical-align:middle;}
- .the_pages input.goButtonCss{width:43px;height:17px;padding:3px 9px 5px;background:#164A84;text-align:center;line-height:18px;color:#fff;font-weight:700;border:0}
- .the_pages span.num{border:none;background:none;color:#000;padding:2px 2px 2px 8px}
- #toPage{ height:20px; width:20px;}
- .the_pages .total{ color:#000;} /*共几页*/