AspNetPager翻页的问题

[复制链接]
查看11 | 回复1 | 2010-7-11 07:55:17 | 显示全部楼层 |阅读模式
protected void Page_Load(object sender, EventArgs e)

{

if (!IsPostBack)

{

Chanelse();

ChannelId = Request.QueryString["id"];

GetHelpInfo();

}

}

private void Chanelse()

{

Chanels.DataSource = new UserAboutBll().GetChannelLists();

Chanels.DataBind();

}

private void GetHelpInfo()

{

if (!string.IsNullOrEmpty(ChannelId))

{

AspNetPager1.RecordCount = Helpbll.GetAll_gethelps(ChannelId);

help_r1.DataSource = Helpbll.Get_HelpList(AspNetPager1.CurrentPageIndex, AspNetPager1.PageSize, ChannelId);

help_r1.DataBind();

}

else

{

AspNetPager1.RecordCount = Helpbll.GetAll_gethelp();

help_r1.DataSource = Helpbll.Get_HelpList(AspNetPager1.CurrentPageIndex, AspNetPager1.PageSize, string.Empty);

help_r1.DataBind();

}

}

///

/// 翻页

///

///

///

protected void AspNetPager1_PageChanged(object sender, EventArgs e)

{

GetHelpInfo();

}
怎么翻页的时候存入ChannelId
翻页时候读取的是ChannelId 内容

回复

使用道具 举报

千问 | 2010-7-11 07:55:17 | 显示全部楼层
你把ChannellId放到ViewState里面就好了a
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行