how to clear browser history when login page load. i want to clear history and cache when my application is initialize.how to do it.i use some codes but not works
What I have tried:
PowerShell
META Http-Equiv="Cache-Control" Content="no-cache"/>
META Http-Equiv="Pragma" Content="no-cache"/>
META Http-Equiv="Expires" Content="0"/>
protected void LogOut()
{
Session.Abandon();
string loggedOutPageUrl = "Logout.aspx";
Response.Write("'javascript'">");
Response.Write("function ClearHistory()");
Response.Write("{");
Response.Write(" var backlen=history.length;");
Response.Write(" history.go(-backlen);");
Response.Write(" window.location.href='" + loggedOutPageUrl + "'; ");
Response.Write("}");
Response.Write("");
}
public void ClearCacheItems()
{
List keys = new List();
IDictionaryEnumerator enumerator = Cache.GetEnumerator();
while (enumerator.MoveNext())
keys.Add(enumerator.Key.ToString());
for (int i = 0; i keys.Count; i++)
Cache.Remove(keys[i]);
}

Khaja MoizuddinRank #270 · 9.4K reputationPosted Jun 1, 2017, 3:18 PM EDT
Midhun TpRank #388 · 6.5K reputationPosted Jun 1, 2017, 9:18 PM EDT