Hello,
I have created project in asp.net , when click browser back or forward button (Navigate browser page), need to redirect into Logout page if its in login state . how can i do it? please help me soon...
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.





Rahul BhattPosted Jul 26, 2012, 5:36 AM
There is best way to solve your problem
Restrict to access goes to Back Button
Meaing : when you click brower back button page not do any action. Still remain in same page
Logic ::
<script type="text/javascript">
window.history.forward();
function noBack() {
window.history.forward();
}
script>
Added above javascript in your Body Tag folloiwng event
1. onLoad
2. OnPageShow
<body onload="noBack();" onpageshow="if(event.persisted) noBack();" >