Contact Form

Name

Email *

Message *

how to clear browser cache in asp.net when Image is changed in ASP.Net

No comments

Solved :

By default browsers cache images using their names hence when the image is replaced on server with same name the changes are not reflected in browser unless the cache is cleared.

C#
Image1.ImageUrl = "~/images/myImage.jpg?" + DateTime.Now.Ticks.ToString();

VB.Net

Image1.ImageUrl = "~/images/myImage.jpg?" + DateTime.Now.Ticks.ToString()

No comments :

Post a Comment