简体   繁体   中英

hide browser back button in the button click

I have a vb .net application in which i'm using a user control for the user registration. This user control has 3 buttons and three asp panels. In each button click corresponding panel will be shown. I need to hide the browser back button functionality only in the 3rd button click. How can i do it? Anyone please help me.

I have tried by putting this line of script in the aspx page which contains the user control.

<script type="text/javascript">
        window.history.forward();
</script>

But it didnt work for me.

Try this

<script type="text/javascript">
    window.history.forward();

    function noBack() {
        window.history.forward();
    }
</script>

<BODY onload="noBack();" onpageshow="if (event.persisted) noBack();" onunload="">

check the DEMO here.

On searching, many geek suggest that this kind of behavior is not good for browser.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM