hi i am trying to clear session varibles its working fine but the problem is when i click back button in browser it is redireding to previous page here i want to do redirect to specied page pls helep me its urgent thanks in advance

Not sure what you're asking, but if you're referring to the browser's back button in the toolbar, I don't think you can influence that. Try putting code into the body of your page:

<a href="pageIwantYouToGoTo.aspx">Back ></a>

Let you have two pages named A and B. When user in B then you do not want to go back to page A. Then write the below code in page A.

<head runat="server"><title>login page</title>
<script type="text/javascript">
setTimeout("window.history.forward(1)", 0);
window.onunload=function{return false;}
</script>
</head >

This ill help u..

logout button ->Redirect to logout.aspx


<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="Head1" runat="server">
<title>Untitled Page</title>
<script type = "text/javascript" >
function disableBackButton()
{
window.history.forward();
window.location='Index.aspx';
}
setTimeout("disableBackButton()", 0);
</script>
</head>
<body onload="disableBackButton()">

<form id="form1" runat="server">

</form>
</body>
</html>

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.