Updated on Kisan Patel
This post will show you how to prevent the page getting stored into the Browser cache to prevent vulnerability of sensitive data in ASP.NET?
The solution of this type of problem is to set the response headers Cache-Control
attribute to “nocache”. To do this, add below code to the Page_Load
event of Master page.
protected void Page_Load(object sender, EventArgs e) { Response.Buffer = true; Response.ExpiresAbsolute = DateTime.Now.AddDays(-5); Response.Expires = -50; Response.Cache.SetCacheability(HttpCacheability.NoCache); }