I think Nick has the right idea. It looks like you are doing a search and populating the ListView in the OnClick method for your search button. You need to search (or, preferably, cache the data for the first time) and associate it with a ListView for each new page that is requested using the DataPager.
You can do this quite easily by creating a method for the ListView OnPagePropertiesChanged event. Perform a search (or pull from the cache) and bind the ListView in this OnPagePropertiesChanged event and your data should fill. Your C # code might look like this:
protected void SearchButton_OnClick(object sender, EventArgs e)
{
PerformSearch();
}
protected void PerformSearch()
{
ListView1.DataSource = data;
ListView1.DataBind();
}
protected void ListView1_OnPagePropertiesChanged(object sender, EventArgs e)
{
PerformSearch();
}
source
share