Given a Web Forms application that is performing poorly because it is repeatedly reading data that doesn't change very often, you need to cache the data to eliminate unnecessary queries and improve the performance.
Use the ASP.NET Cache class.
The solution has a Web Form that defines the data grid used to display the contents of a DataSet, a button to clear the cache, and a label that displays whether the data was retrieved from the cache or from the database. The C# code for the Web Forms page Default.aspx in the project CachingData is shown in Example 10-10.
Example 10-10. File: Default.aspx for CachingData solution
<%@ Page Language="C#" AutoEventWireup="true"...