Tips and tricks for .NET using ASP and VB code.

Prevent browser caching


Protected Sub Page_PreInit(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.PreInit
     Response.CacheControl = "no-cache"
Response.ExpiresAbsolute = Now
Response.Expires = -1
Response.AddHeader("Pragma", "no-cache")
Response.AddHeader("cache-control", "must-revalidate, private, no-cache")
End Sub

No comments:

Post a Comment

Search This Blog