Technical Training
ASP.NET 2.0Table of Contents
ASP.NET State Management And Caching
ASP.NET State Management And Caching - Page 2ASP.NET State Management And Caching Page - 2
ASP.NET State Management And Caching
6. The number of new methods added to the CacheDependency Class make it extensible.
a. DependencyDispose is a protected method that releases the resources used by the class
b. GetUniqueID is a public method that retrieves a unique string identifier for the object
c. NotifyDependencyChanged is a protected method that informs the base class that the dependency .represented by an object has changed.
..................d. SetUtcLastModified is a protected method that marks the time when a dependency
..................changes.
..................e. HasChanged is a public Boolean read only property that indicates whether the
..................dependency has changed
..................f. UtcLastModified is a public read only property that gets the time from the
..................SetUtcLastModified.
7. The CacheDependency class has been designed to support only a limited set of well known dependencies. For instance the user cannot insert code to check whether a dependency condition has been meant.
..................a. The CacheDependency object internally sets up a file monitor object and receive a call
..................from it whenever the monitored object changes. This object is called a
..................FileSystemWatcher object .
..................b. It has an event handler and establishes a link between the CacheDependency object
..................and the Cache object and its items.
..................c. An event is fired whenever the monitored object changes.
8. In addition to creating a single dependency on an entry ASP.NET Cache also aggregates dependencies. For instance, a Cache entry can be made dependent both on a file and a SQL Server table.
..................a. Custom cache dependency objects inherit CacheDependency, so the array of
..................dependencies can be extremely wide.
..................b. The AggregateCacheDependency class is built as a custom cache dependency object
..................and inherits from the CacheDependency class.
9. The SqlCacheDependency class which inherits from CacheDependency class supports dependencies on SQL Server tables.
..................a. It implements features that are compatible with MSDE, SQL Server 7.0 and subsequent
..................versions.
..................b. The class works only when the tables on which dependencies have to be created are
..................enabled.
..................c. The SqlCacheDependency class has two constructors. The first takes the
..................SqlCommand object and the second accepts two strings—the database name and
..................the table name.
.............................i. The SqlCacheDependency class sets up a dependency relationship with SQL
................................Server 2005 known as command notification.
.............................ii. Whenever there are changes in the tables involved the notification is sent to the
.................................caller.
.............................iii. The caller then handles the event and lets the parent know through the
.................................. NotifyDependencyChanged.
..................d. Triggers and stored procedures will have to be created to handle any incoming
..................UPDATE, INSERT and DELETE statements.
..................e. This must be done before the application is published.
..................f. The command line tool aspnet_regsqlcache or the methods of
..................SqlCacheDependencyAdmin can be used to enable the database for notifications.
..................g. The database entry is to be bound to a connection string entry
..................h. The poll component then, accesses the newly created table to see whether other tables
..................have changed.
..................i. If one or more tables have to be monitored for changes they can be added to a list
..................programmatically by defining a trigger on the table that is sensitive to insert, updates and
..................deletions. The trigger can increment the value of the ChangeID column.
j. A key architectural component is the cache dependency manager object. This component accesses the table and reads the ChangeID field and informs the corresponding cache object if a change has occurred.
k. The cache dependency object is dependent on a helper cache key, whose name is defined in accordance with the table and the database. This helper cache entry is removed so that the original SqlCacheDependency object is invalidated.
ASP.NET 2.0
- Getting started with ASP.NET 2.0
- .NET Framework Fundamentals
- Microsoft.NET Framework Tools
- Application Development in .NET
- What's New in the .NET Framework 2.0 ?
- Introduction to Visual Studio.NET
- Installing Visual Studio.NET 2005
- Working with Visual Studio.NET Web Applications
- Whats New in ASP.NET 2.0
- Creating an ASP.NET Application
- ASP.NET Code Directory
- ASP.NET Page Object Model
- ASP.NET Server Controls
- ASP.NET Working With Master Pages
- ASP.NET Creating Content for Master Page
- ASP.NET Referencing Master Page Members
- ASP.NET Changing Master Pages Dynamically
- ASP.NET Creating Nested Master Pages
- ASP.NET Working with Web Parts
- ASP.NET Using Web Parts and Controls in Web Pages
- ASP.NET Web Pages and Layout
- ASP.NET - Adding Web Parts at Run Time
- ASP.NET Personalization: User Profiles and Themes
- ASP.NET Data Access features
- ASP.NET State Management
- ASP.NET Customizing the Session State Mechanism
- ASP.NET State Management And Caching
- ASP.NET Security
- Forms Authentication in ASP.NET
- ASP.NET Managing Membership and Roles
- ASP.NET Configuring Page-Level Caching
- ASP.NET Setting Application-Level Caching
- ASP.NET Data Source Object Model
- ASP.NET SqlDataSource Control
- ASP.NET Data Bound Controls
- ASP.NET GridView Control
- ASP.NET GridView Filtering
- ASP.NET Adding Sorting and Paging in GridView
- ASP.NET DataBound Controls - Details View
- ASP.NET Using a Grid to Display Detail Information
- ASP.NET Displaying Master-Detail Data on the Same Page
- Displaying Master-Detail Data on Separate Pages in ASP.NET
- ASP.NET Creating Web Wizards
- ASP.NET : Dynamic Image control
- ASP.NET Advanced Site Functionality







