Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
435
Problems using cache
posted

Hi,

I have a webhierarchicaldatagrid with paging linked to a webhierarchicaldatasource linked to an objectdatasource that returns a lot of records so i decided to enable the cache of the objectdatasource.

My problem is that i cant manage to refresh the cache and make the grid show the new data.

In my code i use a button to refresh the cache and when i click that button, the selecting method of the objectdatasource is called and the webhierarchicaldatagrid shows the first page of the data but when i click the "next page" link it shows no data and no prev or next page buttons.

This is the code i use to refresh the cache:

protected void btRefresh_Click(object sender, EventArgs e)

        {

            ObjectDataSource.EnableCaching = false;

            WHDGMovs.DataBind();        

            ObjectDataSource.EnableCaching = true;

        }

 

What am i doing wrong ?