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.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Atul KumarRank #1,526 · 1K reputationPosted Jul 25, 2012, 3:42 AM EDT
Nouf CP6 reputationPosted Jul 25, 2012, 10:27 PM EDT
Atul KumarRank #1,526 · 1K reputationPosted Jul 25, 2012, 10:37 PM EDT
Nouf CP6 reputationPosted Jul 25, 2012, 11:08 PM EDT
1) By clicking link
2)Navigate (Back or forward) .
when page load by clicking links, its need not be logout if in login state.. Otherwise by 2nd option (forward or backward) will need to be logout ,if in login state.When i check session in the load event it will logout in both cases..Actually, i need to detect page is loading by clicking the links or through navigation(back or forward) .pls help me.
Atul KumarRank #1,526 · 1K reputationPosted Jul 25, 2012, 11:26 PM EDT
Request.UrlReferrer.ToString();
Rahul Bhatt165 reputationPosted Jul 26, 2012, 1:36 AM EDT
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();" >