在我的aspNetPager控件中,我按了第二页的按钮,currentPageIndex的值变成了2,可是为什么按钮还是停留在第一页,只能按第二页不能按第一页,内容是第二页的内容~~~~,也就是说你跳到第二页之后不能跳回到第一页~~~~~,不知道为什么,有谁有过相似的经验吗???

解决方案 »

  1.   

    这是页面跳转的代码~~~~~protected void AspNetPager1_PageChanged(object sender, EventArgs e)
        {
            postBackDetailsInfoBind();
            Response.Redirect("BrowsePost.aspx?forumID=" + forumID + "&currentPage=" + AspNetPager1.CurrentPageIndex.ToString());
        }
    这是load的代码  public void Page_Load(object sender, EventArgs e)
        {
            if(login.UserIsLogin)
            user_id = login.CurrentUserModelInSession.UserId.ToString();
                 
            forumID = WebUtils.GetQueryString("forumID");
            if (!IsPostBack)
            {
                DataSet ds = (new BbBll()).getAllPostBackDetailsInfo(forumID);
                AspNetPager1.RecordCount = ds.Tables[0].Rows.Count;
                postBackDetailsInfoBind();          
            }               
        }这两个都是一个页面的
      

  2.   

    分页以后又redirect到第一页,好像没有绑定数据。
      

  3.   

    我发现就是redirect之后,aspnetpage有初始化了~~~ 但是aspnetpager又无法设置currentIndex的数据~~~~