Hi,
I have a Datagrid that returns search results. It was working fine but now when you click on a paging link it returns ALL records rather than just those returned from the search.
Example:
click on search:
- searchresults.aspx shows 5 records saying '1 to 5 of 23'
click on a link to page 2 or page 3 etc and:
- searchresults.aspx shows 5 records saying '6 to 10 of 102'
The paging links are default DataGrid paging links.
The DataGrid is cached as 'dv'+ Session.SessionID,
Does anyone know what may be going wrong?
here's my PageIndexChanged code:
thanks in advance,
Pete
I have a Datagrid that returns search results. It was working fine but now when you click on a paging link it returns ALL records rather than just those returned from the search.
Example:
click on search:
- searchresults.aspx shows 5 records saying '1 to 5 of 23'
click on a link to page 2 or page 3 etc and:
- searchresults.aspx shows 5 records saying '6 to 10 of 102'
The paging links are default DataGrid paging links.
The DataGrid is cached as 'dv'+ Session.SessionID,
Does anyone know what may be going wrong?
here's my PageIndexChanged code:
Code:
private void DataGrid1_PageIndexChanged(object source, System.Web.UI.WebControls.DataGridPageChangedEventArgs e)
{
DataGrid1.CurrentPageIndex = e.NewPageIndex;
DataGrid1.DataSource = (DataView)Cache["dv" + Session.SessionID];
DataGrid1.DataBind();
SetPageStats();
}
thanks in advance,
Pete