Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/333.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 具有缓存对象的GridView分页事件_C#_Asp.net_Ado.net - Fatal编程技术网

C# 具有缓存对象的GridView分页事件

C# 具有缓存对象的GridView分页事件,c#,asp.net,ado.net,C#,Asp.net,Ado.net,我显示Gridview数据表单缓存对象。当我单击页码时,它显示空白网页。如何使用缓存对象处理分页。 是否需要在分页事件中检查相同的条件 DataTable GetByCahe =(DataTable) Cache["DataStore"]; if (GetByCahe != null) { ManageRegGrid.DataSource = GetByCahe; ManageRe

我显示Gridview数据表单缓存对象。当我单击页码时,它显示空白网页。如何使用缓存对象处理分页。
是否需要在分页事件中检查相同的条件

 DataTable GetByCahe =(DataTable) Cache["DataStore"];
            if (GetByCahe != null)
            {
                ManageRegGrid.DataSource = GetByCahe;
                ManageRegGrid.DataBind();
            }
            else
            load From the database

如果缓存的数据不可用,则需要同样的检查和重新绑定