c# - Stop redirect page on back button click -


i'm trying remove history particular site. when i'm logout page , press button, page move in previous page want when user logout , press button on same page login page not go in previous page. i'm trying method session abandon, cache remove problem not solved. can use javascript.

protected void btnlogout_click(object sender, eventargs e) {     httpcontext.current.cache.remove("");     httpcontext.current.session.clear();     httpcontext.current.session.abandon();     response.redirect("../login.aspx"); }  

you can try using javascript:

 <script type="text/javascript">     //logout clears visited pages button     function noback() { window.history.forward(); }     noback();     window.onload = noback;     window.onpageshow = function (evt) { if (evt.persisted) noback(); }     window.onunload = function () { void (0); } </script> 

Comments

Popular posts from this blog

java - activate/deactivate sonar maven plugin by profile? -

python - TypeError: can only concatenate tuple (not "float") to tuple -

java - What is the difference between String. and String.this. ? -