You must Sign In to post a response.
  • Category: ASP.NET

    Pressing Backspace Button deletes IFrame-IE 11

    Hi All,
    I have an aspx page loaded within an IFRAME.
    Whenever I hit 'Backspace' in the aspx page within the IFRAME the entire contents of the aspx page disappear.It is working with IE-8 but with IE 11 has issue.
    How can i stop this issue?.
    Thanks.
  • #766738
    Hi

    you can add you page for Restricted Backspace event . write this script in your html or aspx page and try
    8 is ascii code for Backspace.



    $(document).on("keydown", function (e) {
    if (e.which === 8 && !$(e.target).is("input, textarea")) {
    e.preventDefault();
    }
    });


    Name : Dotnet Developer-2015
    Email Id :kumaraspcode2009@gmail.com

    'Not by might nor by power, but by my Spirit,' says the LORD Almighty.

  • #766756
    Hi,

    You can use below JavaScript to disable browser Back button, Keep this in your login.aspx page.


    <script type = "text/javascript" >
    function disableBackButton()
    {
    window.history.forward();
    }
    setTimeout("disableBackButton()", 0);
    </script>


    Also make sure to clear the session and redirect to login page if you are using session to validate the user across the page.


    protected void btnLogOut_Click(object sender, EventArgs e)
    {
    Session.Abandon();
    respose.redirect("Login.aspx");
    }



    Regards,
    Asheej T K
    Microsoft MVP[ASP.NET/IIS]
    DotNetSpider MVM

  • #766780
    you need to turned on 'compatibility view' in IE 11 and try test web site
    see below steps to set compatibility
    1. Open IE 11
    2.Press the Alt key to display the menu bar.
    3.Click the Tools menu and choose Compatibility View Settings.
    4.In the field for Add this website, you will see the domain, that is, the last part of the website address, such as mit.edu or successfactors.com
    5.Click Add.
    Result: the domain (mit.edu or other domain) appears in the list of "Websites you've added to Compatibility View".
    hope it helps

    Thanks
    Koolprasd2003
    Editor, DotNetSpider MVM
    Microsoft MVP 2014 [ASP.NET/IIS]


Sign In to post your comments