asp.net中的repeater如何实现翻页?

来源:百度知道 编辑:UC知道 时间:2024/05/15 11:32:35
数据来源是datatable,由于格式比较个性化不能使用像datagrid这样的行列式格式,因此用了repeater,但是该如何翻页呢? 要求不能在.aspx后面加参数。

以下代码作废,但是不想删除,特意为你找的,刚刚没有看到你说不要参数,那么你就用一个Session["abc"]慢慢读咯
、、==============
通过传递参数实现,下面给出DataList的例子。(VS2003)

protected System.Web.UI.WebControls.HyperLink hlNext;
protected System.Web.UI.WebControls.HyperLink hlPrev;
protected System.Web.UI.WebControls.Label lblPage;
protected System.Web.UI.WebControls.Label Label3;
protected System.Web.UI.WebControls.Label lblRecord;
protected System.Web.UI.WebControls.Label Label1;
protected System.Web.UI.WebControls.DataList myDataList;
protected System.Web.UI.WebControls.HyperLink HyperLink1;
protected System.Web.UI.WebControls.HyperLink hlRecommand;
protected System.Web.UI.WebControls.Image Image1;

private void Page_Load(object sender, System.EventArgs e)
{
// 在此处放置用户代码以初始化页面

BindList();//显示相关新闻
InitUrl();//初始化超级链接的链接路径(带参数)

}

public void InitUrl()
{
// "