Siteserver-stl:pageSqlContents翻页获取数据库数据列表
查看全部词条命名空间:Main
导航: 上一页
stl:pageSqlContents 翻页数据库列表
属性列表
下表显示所有属于此元素的属性列表。所有属于STL 元素 <stl:sqlContents> 的成员均适用于<stl:pageChannels>元素。属于 <stl:sqlContents> 的成员未在下表列出。
| 属性 | 可能的取值 | 默认值 | 简介 |
|---|---|---|---|
| pageNum | 每一页显示的数据库数目 |
注意:
- <stl:pageSqlContents> 元素和 <stl:sqlContents> 具有相同的属性,这两个元素的区别在于<stl:pageSqlContents>能够翻页,参见 翻页元素与实现。
- 通常将STL 元素 <stl:pageItems> 及 <stl:pageItem> 置于 <stl:pageSqlContents> 元素的下方,代表翻页按钮。
stl:pageSqlContents 示例
- 示例一:显示能够翻页的数据库列表
下面的例子显示指定SQL语句的数据库的列表。
<stl:pageSqlContents connectionString="server=(local);uid=sa;pwd=bairong;
Trusted_Connection=no;database=ccs" cellpadding="2" cellspacing="2" pageNum="10">
<stl:queryString>
SELECT TOP 6 Title, PostDate, PostUrl FROM MyTable
WHERE (PostType = 1) ORDER BY PostDate DESC
</stl:queryString>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td>·<a href=""><stl:sqlContent type="Title" wordnum="20"></stl:sqlContent></a></td>
<td><stl:sqlContent type="PostDate" formatString="yyyy-MM-dd"></stl:sqlContent></td>
</tr>
</table>
</stl:pageSqlContents>
<br />
<stl:pageItems>
<table cellpadding="0" cellspacing="0" width="90%" height="40" align="center">
<tr>
<td align="left">
<stl:pageItem type="FirstPage" text="首页"></stl:pageItem> |
<stl:pageItem type="PreviousPage" text="上一页"></stl:pageItem> |
<stl:pageItem type="NextPage" text="下一页"></stl:pageItem> |
<stl:pageItem type="LastPage" text="末页"></stl:pageItem>
</td>
<td align="right">
<stl:pageItem type="CurrentPageIndex" text="当前页:"></stl:pageItem>
<stl:pageItem type="PageNavigation"></stl:pageItem>
</td>
</tr>
</table>
</stl:pageItems>
<stl:pageSqlContents connectionString="server=(local);uid=sa;pwd=bairong;
Trusted_Connection=no;database=ccs" cellpadding="2" cellspacing="2" pageNum="10">
<stl:queryString>
SELECT TOP 6 Title, PostDate, PostUrl FROM MyTable
WHERE (PostType = 1) ORDER BY PostDate DESC
</stl:queryString>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td>·<a href=""><stl:sqlContent type="Title" wordnum="20"></stl:sqlContent></a></td>
<td><stl:sqlContent type="PostDate" formatString="yyyy-MM-dd"></stl:sqlContent></td>
</tr>
</table>
</stl:pageSqlContents>
<br />
<stl:pageItems>
<table cellpadding="0" cellspacing="0" width="90%" height="40" align="center">
<tr>
<td align="left">
<stl:pageItem type="FirstPage" text="首页"></stl:pageItem> |
<stl:pageItem type="PreviousPage" text="上一页"></stl:pageItem> |
<stl:pageItem type="NextPage" text="下一页"></stl:pageItem> |
<stl:pageItem type="LastPage" text="末页"></stl:pageItem>
</td>
<td align="right">
<stl:pageItem type="CurrentPageIndex" text="当前页:"></stl:pageItem>
<stl:pageItem type="PageNavigation"></stl:pageItem>
</td>
</tr>
</table>
</stl:pageItems>