日期:2014-05-20  浏览次数:20456 次

---@@@@@@@@@@@@@@@@@@@谁用过webdiyer的AspNetPage控件?高手请进,帮我看看
我的程序在没有查询时分页是正常的,但是在查询后,从第一页上看确实是查询的结果,但是在点下一页时显示的又是所有的纪录。郁闷阿
我的程序:
        Private   Sub   Page_Load(ByVal   sender   As   System.Object,   ByVal   e   As   System.EventArgs)   Handles   MyBase.Load
                If   (Not   Page.IsPostBack)   Then
                     
                        cmd   =   New   SqlCommand( "[dbo].[Page_RebResult] ",   Conn)
                        cmd.CommandType   =   CommandType.StoredProcedure
                        cmd.Parameters.Add( "@pageindex ",   1)
                        cmd.Parameters.Add( "@pagesize ",   1)
                        cmd.Parameters.Add( "@docount ",   True)
                        cmd.Parameters.Add( "@username ",   User.Identity.Name)

                        conn.Open()
                        AspNetPager1.RecordCount   =   cmd.ExecuteScalar()
                        conn.Close()
                        BindData()

                        End   If
                '在此处放置初始化页的用户代码
        End   Sub
        Sub   AddCustomText()
                aspnetpager1.CustomInfoText   =   "记录总数: <font   color= 'blue '> <b> "   +   aspnetpager1.RecordCount.ToString()   +   " </b> </font> "
                aspnetpager1.CustomInfoText   +=   "   总页数: <font   color= 'blue '> <b> "   +   aspnetpager1.PageCount.ToString()   +   " </b> </font> "
                aspnetpager1.CustomInfoText   +=   "   当前页: <font   color= 'red '> <b> "   +   aspnetpager1.CurrentPageIndex.ToString()   +   " </b> </font> "
                'Session( "page ")   =   aspnetpager1.CurrentPageIndex.ToString()
        End   Sub
        Sub   BindData()
                cmd   =   New   SqlCommand
                cmd.Connection   =   Conn
                cmd.CommandType   =   CommandType.StoredProcedure
                If   Not   (ViewState( "doSearch ")   Is   Nothing)   Then