Disabling Client side Caching in ASP.NET 2.0

I saw many people are struggling to disable client side caching. Recently one of my friends told me that he had a problem in a page related to client side caching.

Problem.

He tried to update the photo of the currently logged in user. From edit personal info page he uploaded new photo of the user but when it comes to view profile page the same old photo is showing over there due to the client side caching. One thing you have to taken into consideration is the image name, there he is using same image name so when he goes to other pages after updation of image he will see only the old image due to client side caching.

We can avoid client side page caching by following line of code

Response.Cache.SetCacheability(HttpCacheability.NoCache);

Cool right