hi,
I m doing project in ASP.Net so i want code which how i m clear the history of IE plz rply

Recommended Answers

All 3 Replies

<META HTTP-EQUIV="Pragma" CONTENT="no-cache">
add this to your aspx page or
in code behind add this one

response.expires = 0
response.cache.setnostore()
response.appendheader("Pragma", "no-cache")

hope that helps

you can also do with C# code for clearing cache.

string cacheKey;
IDictionaryEnumerator CacheEnum = HttpContext.Current.Cache.GetEnumerator();
 while (CacheEnum.MoveNext())
                {
                    cacheKey = CacheEnum.Key.ToString();
                    HttpContext.Current.Cache.Remove(cacheKey );
                }

To clear history using java script code just try following code.
<%
Response.Buffer = True
Response.ExpiresAbsolute = Now() - 1
Response.Expires = 0
Response.CacheControl = "no-cache"

If Len(Session("FirstTimeToPage")) > 0 then

Session("FirstTimeToPage") = ""
Response.Redirect "home.aspx"'home page
Response.End
End If


%>

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.