Hello Firends,
sorry after so long time i m writing post on my site. i was busy in very interesting project same as digg.com.
now i will give you so much new things which will likes a lot for asp .net programmers.
here is very interesting thing i m giving to you many asp .net programmers need to disable the broswer back button after any user logout from the website or other reason is some how if we used the javascript on the page so after page will redirect user can`t go to the last page because when you use the javascipt on the page then if user press the back button all the data comes from the cache not from the server side so it may cause big problems in the website.
so here is the solution for the asp.net programmers.
Response.Cache.SetCacheability(HttpCacheability.NoCache)
Response.Cache.SetExpires(DateTime.Now.AddSeconds(-1))
Response.Cache.SetNoStore()
just put above code in the page_load() event.
this code does not save the cache data on the client side`s browser it will work for any broswer.
if you are using the master page in the asp.net web site then just put above code in the master page`s page load event.
if you paste this code in master page`s page_load() event then all the child pages automatically inherent code so no need to place code in individual child pages.
I hope you like this code please post comments you like it or not or it will works for you or not.
Thanks In Advance.
Tags: Disable browser`s back button, Disable browser`s back button functionality, Disable browser`s back button functionality in ASP.NET
Hello ! I am Arjun Jadeja a Software Engineer by Profession. You can contribute and I will distribute your ideas through this site. Thanks and Enjoy
Leave a reply