新闻内容页分页的简单做法
2007-06-06 11:52
393 查看
很简单的做法,这个是假设数据已经拿出来了,不用再去数据库折腾了
另外,如果喜欢折腾数据库的朋友可以使用如下SQL语句得到指定位置的指定字数的内容
这个是指定位置的select a from b where len(a)>=100 and len(a)<=400 --查字段a的字符串长度在100到400之间的
select substring(a,100,400) from b --查询a字段从第100个字符起到400个字符止的字符串.
(星缘梦雨)
3<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
4
5<html xmlns="http://www.w3.org/1999/xhtml" >
6<head runat="server">
7 <title>无标题页</title>
8</head>
9<body>
10 <form id="form1" runat="server">
11 <div>
12 <asp:Button ID="nbtn" runat="server" Enabled="False" Height="23px" OnClick="nbtn_Click"
13 Style="z-index: 100; left: 301px; position: absolute; top: 241px" Text="下一页" />
14 <asp:Button ID="pbtn" runat="server" Enabled="False" Height="23px" OnClick="pbtn_Click"
15 Style="z-index: 101; left: 222px; position: absolute; top: 241px" Text="上一页" />
16 <asp:Panel ID="Panel1" runat="server" Height="201px" Style="z-index: 103; left: 12px;
17 position: absolute; top: 8px" Width="654px">
18 <asp:Label ID="Label1" runat="server" Style="z-index: 100; left: 261px; position: absolute;
19 top: 278px" Text="Label"></asp:Label>
20 </asp:Panel>
21
22 </div>
23 </form>
24</body>
25</html>
26
using System;
2using System.Data;
3using System.Configuration;
4using System.Collections;
5using System.Web;
6using System.Web.Security;
7using System.Web.UI;
8using System.Web.UI.WebControls;
9using System.Web.UI.WebControls.WebParts;
10using System.Web.UI.HtmlControls;
11
12public partial class Default2 : System.Web.UI.Page
13
另外,如果喜欢折腾数据库的朋友可以使用如下SQL语句得到指定位置的指定字数的内容
这个是指定位置的select a from b where len(a)>=100 and len(a)<=400 --查字段a的字符串长度在100到400之间的
select substring(a,100,400) from b --查询a字段从第100个字符起到400个字符止的字符串.
(星缘梦雨)
3<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
4
5<html xmlns="http://www.w3.org/1999/xhtml" >
6<head runat="server">
7 <title>无标题页</title>
8</head>
9<body>
10 <form id="form1" runat="server">
11 <div>
12 <asp:Button ID="nbtn" runat="server" Enabled="False" Height="23px" OnClick="nbtn_Click"
13 Style="z-index: 100; left: 301px; position: absolute; top: 241px" Text="下一页" />
14 <asp:Button ID="pbtn" runat="server" Enabled="False" Height="23px" OnClick="pbtn_Click"
15 Style="z-index: 101; left: 222px; position: absolute; top: 241px" Text="上一页" />
16 <asp:Panel ID="Panel1" runat="server" Height="201px" Style="z-index: 103; left: 12px;
17 position: absolute; top: 8px" Width="654px">
18 <asp:Label ID="Label1" runat="server" Style="z-index: 100; left: 261px; position: absolute;
19 top: 278px" Text="Label"></asp:Label>
20 </asp:Panel>
21
22 </div>
23 </form>
24</body>
25</html>
26
using System;
2using System.Data;
3using System.Configuration;
4using System.Collections;
5using System.Web;
6using System.Web.Security;
7using System.Web.UI;
8using System.Web.UI.WebControls;
9using System.Web.UI.WebControls.WebParts;
10using System.Web.UI.HtmlControls;
11
12public partial class Default2 : System.Web.UI.Page
13
相关文章推荐
- (转载)新闻内容页分页的简单做法
- 新闻内容页分页的简单做法
- 新闻内容页分页的简单做法
- 内容分页简单实现代码及祥解(C#)
- ListView显示自定义新闻内容简单Adapter用法
- 一步步打造漂亮的新闻列表(无刷新分页、内容预览)(1)
- 一步步打造漂亮的新闻列表(无刷新分页、内容预览)(2)
- 一步步打造漂亮的新闻列表(无刷新分页、内容预览)第二步
- 一步步打造漂亮的新闻列表(无刷新分页、内容预览)第二步
- AspNetPager 新闻内容分页
- 内容分页简单实现代码及祥解(C#)
- 一步步打造漂亮的新闻列表(无刷新分页、内容预览)(1)
- 一步步打造漂亮的新闻列表(无刷新分页、内容预览)(2)
- 一步步打造漂亮的新闻列表(无刷新分页、内容预览)第一步
- (转)SSH + Lucene + 分页 + 排序 + 高亮 模拟简单新闻网站搜索引擎
- 一步步打造漂亮的新闻列表(无刷新分页、内容预览)(3)
- C#新闻内容过长,内容分页
- 新闻内容实现分页
- 一步步打造漂亮的新闻列表(无刷新分页、内容预览)(3)
- 一步步打造漂亮的新闻列表(无刷新分页、内容预览)第三章