datalist分页(页面部分)

分页|页面

<body MS_POSITIONING="GridLayout" topmargin="5" leftmargin="1" rightmargin="5">
        <table width="100%">
            <tr>
                <td>
                    <cj168:Header ID="Header1" runat="server" />
                </td>
            </tr>
        </table>
        <form id="search" method="post" runat="server">
            <table border="0" cellspacing="0" cellspacing="0" width="98%" align="center">
                <TBODY>
                    <tr>
                        <td class="pagetop">
                            <span style="float:left">已搜索有关
                                <asp:Label ID="lblTxtSearch" Font-Bold="True" Runat="server"></asp:Label>
                                的文章</span><span style="float:right">共有<asp:Label id="lblRecordCount" Font-Bold="true" runat="server" />项结果, 这是第<asp:Label id="lblPageRange" Font-Bold="true" runat="server" />项。
                            </span>
                        </td>
                    </tr>
                    <tr>
                        <td height="20">
                             
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <asp:DataList id="datalistSearchResult" runat="server" HorizontalAlign="left" Width="100%">
                                <ItemTemplate>
                                    <table border="0" width="100%" align="left">
                                        <tr>
                                            <td>
                                                <asp:HyperLink ID="Hyperlink2" text='<%# DataBinder.Eval(Container.DataItem, "MainHeader").ToString().Trim()%>' NavigateUrl='<%# "showIssueCat.aspx?MagName=" + Server.UrlEncode(DataBinder.Eval(Container.DataItem, "MagName").ToString()) + "&MagID=" + DataBinder.Eval(Container.DataItem, "MagID") + "&MagYear=" + DataBinder.Eval(Container.DataItem, "MagYear") + "&YearIssue=" + DataBinder.Eval(Container.DataItem, "YearIssue") + "&ArtID=" + DataBinder.Eval(Container.DataItem, "txtID") %>' target="_blank" Runat="server" CssClass="MenuSelected">
                                                </asp:HyperLink>
                                                <span class="maginfo">
                                                    <%# Server.HtmlEncode(DataBinder.Eval(Container.DataItem, "MagName").ToString()) %>
                                                    <%# DataBinder.Eval(Container.DataItem, "MagYear") %>
                                                    年度 第<%# DataBinder.Eval(Container.DataItem, "YearIssue") %>期</span>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td class="content">
                                                <%# ((String)DataBinder.Eval(Container.DataItem, "Content")).Substring(0,100)%>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td height="20">
                                                 
                                            </td>
                                        </tr>
                                    </table>
                                </ItemTemplate>
                            </asp:DataList>
                        </td>
                    </tr>
                    <tr>
                        <td align="middle">
                            <br>
                            <asp:LinkButton id="lbnPrevPage" Text="上一页" CommandName="prev" OnCommand="Page_OnClick" runat="server" />
                            <asp:LinkButton id="lbnNextPage" Text="下一页" CommandName="next" OnCommand="Page_OnClick" runat="server" />
                            当前为<asp:Label id="lblCurrentPage" Font-Bold="true" runat="server" />/<asp:Label id="lblPageCount" Font-Bold="true" runat="server" />页
                        </td>
                    </tr>
                </TBODY>
            </table>
        </form>
        <table border="0" width="100%">
            <tr>
                <td>
                    <cj168:Footer id="Footer1" runat="server" />
                </td>
            </tr>
        </table>
    </body>

时间: 2024-10-03 00:17:36

datalist分页(页面部分)的相关文章

运用工具类分页 页面怎么写?

问题描述 运用工具类分页 页面怎么写? 我对分页的页面不知道怎么下手 工具类 在页面 如何使用不清楚,求高人指点 public class Pagination implements Serializable { private static final long serialVersionUID = 1L; private int start; // start表示当前页开始的记录数,start=每页行数*(当前页数-1) private int end; // 当前页结束的记录行数 priv

如何用datalist分页(asp.net 用VB)

问题描述 如何用datalist分页(asp.net用VB)来实现在面网站的分页效果http://www.f7bbs.com/bbs/forum-24-1.html先在这里说一声谢谢啦大家-- 解决方案 解决方案二:http://www.21tx.com/dev/2002/03/31/10059.html解决方案三:aspnetpage控件解决方案四:这个控件不会用啊可以说一下要注意点什么吗

asp.net控件DataList分页用法_实用技巧

本文实例讲述了asp.net控件DataList分页用法.分享给大家供大家参考,具体如下: protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { ViewState["Page"] = 0; Bangding(); } } //绑定数据 public void Bangding() { PagedDataSource pds = new PagedDataSource(); pds.DataS

AspNetPager 和 datalist 分页 id传值跳转

问题描述 AspNetPager和datalist分页id传值跳转只显示一页的内容按下一页就空乐SqlConnectioncon=db.con();con.Open();SqlCommandcom=newSqlCommand("selectcount(*)fromproductwheretypeid='"+Request.QueryString["id"]+"'",con);AspNetPager1.AlwaysShow=true;AspNetP

求一个WEB控件写DATALIST分页

问题描述 由于我多次用到分页所以想写个用户控件但是数据源每次都不一样我不知道应该怎么写?然后调用到页面应该怎么用.下面是我的分页代码protectedvoidPage_Load(objectsender,EventArgse){if(!IsPostBack){bind();}}voidbind(){intcurpage=Convert.ToInt32(this.Label1.Text);PagedDataSourceps=newPagedDataSource();pagebind(ps);ps.

datalist分页(codebehind部分)

分页 using System;using System.Collections;using System.Configuration;using System.ComponentModel;using System.Data;using System.Data.SqlClient;using System.Drawing;using System.Web;using System.Web.SessionState;using System.Web.UI;using System.Web.UI.

DataList分页,大家帮帮忙```

问题描述 我点下一页,到第2页他就点不下去了,没反映.然后点上一页,就抱错说索引范围,不能为负数.我是新手大家看看代码,帮帮小弟protectedvoidLinkButton1_Click(objectsender,EventArgse)//上一页{this.Label2.Text=Convert.ToString(Convert.ToInt32(this.Label2.Text)-1);intcurpage;curpage=Convert.ToInt32(this.Label2.Text);d

DataList分页问题

问题描述 实现第一页,下一页,上一页,最后一页 解决方案 解决方案二:try{conn.Open();SqlDataAdapterda=newSqlDataAdapter("select*fromCommentary",conn);DataSetds=newDataSet();da.Fill(ds,"Commentary");conn.Close();objpds=newPagedDataSource();objpds.DataSource=ds.Tables[0]

datalist分页

问题描述 求datalist控件分页代码,我的数据库是Access 解决方案 解决方案二: 解决方案三:aspnetpager解决方案四:http://blog.csdn.net/xianfajushi/article/details/7015535