This blog is moved to

Tuesday, June 17, 2008

ASP.Net Caching

We can easily cache data in using the Caching class provided by

Here is an example of how to cache data.

Cache.Insert("data", data, null, System.Web.Caching.Cache.NoAbsoluteExpiration, System.Web.Caching.Cache.NoSlidingExpiration);

This will cache the "data" until it is removed from the memory.

So how can we know when the cached data is being removed from the memory?

ASP.Net provides a cool feature, that enables us to do it.

There is a delegate to achieve this
which has the following signature

void RemoveCacheItemHandler(string key, Object value, CacheItemRemovedReason reason);

This delegate can be used to get notification once a particular cached item being removed.

Example of how we can use the delegate:

Cache.Insert("data", data, null, System.Web.Caching.Cache.NoAbsoluteExpiration, System.Web.Caching.Cache.NoSlidingExpiration, RemoveCacheItemHandler);

public void RemovedCacheItemHandler(string key, Object value, CacheItemRemovedReason reason)
switch (key)
case "data":
// cache has been removed; do the process

Tuesday, June 10, 2008

Tracking changes in Microsoft Word Document

In tools select Track Changes.

You can make sure the word is tracking changes by looking for "TRK" in status bar.

Monday, June 9, 2008

Query String + Special Characters

For sending special characters as Querystring

In javascript we can use the function escape to encode
In .Net we can user Server.URLEncode

To decode the string we can use unescape in javascript
and Server.URLDecode in .Net

Thats all ;p