Clear cache in C#.net Code Behind

February 27, 2013

Using this Code you can clear the browser cache.

You can also use it on LogOut of your site.

Response.Cache.SetExpires(DateTime.UtcNow.AddMinutes(-1));
Response.Cache.SetCacheability(HttpCacheability.NoCache);
Response.Cache.SetNoStore();


Get Current Page Name Using Javascript

February 27, 2013

Using this script you can get the name of current page.

<script language=”javascript”>
function getPageName() {
var URL = window.location.pathname;

var PageName = URL.substring(URL.lastIndexOf(‘/’) + 1);
//alert(PageName);
return PageName;

}
</script>