[CLOSED] Back button

  1. #1

    [CLOSED] Back button

    With Coolite, Is there a way to disable the back button?

    Thanks.
  2. #2

    RE: [CLOSED] Back button

    Hi,

    Unfortunatelly, the back button is browser UI element which is not accessable from javascript. But you can clear history
    http://answers.google.com/answers/th...id/574062.html
    http://www.boutell.com/newfaq/creating/backbutton.html
    http://csharpdotnetfreak.blogspot.co...avascript.html
  3. #3

    RE: [CLOSED] Back button

    Hi,

    Maybe handling the <WindowUnload> event would help.

    Example

    <%@ Page Language="C#" %>
    
    <%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
    
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
        <title>Ext.NET Example</title>
    </head>
    <body>
        <form runat="server">
            <ext:ResourceManager runat="server" WindowUnloadMsg="Testing...">
                <Listeners>
                    <WindowUnload Handler="return true;" />
                </Listeners>
            </ext:ResourceManager>
        </form>
    </body>
    </html>
    Geoffrey McGill
    Founder
  4. #4

    RE: [CLOSED] Back button

    Another option is using the <ext:History> component.

    See https://examples1.ext.net/Examples/M...History/Basic/

    Geoffrey McGill
    Founder
  5. #5

    RE: [CLOSED] Back button

    The ext:history option is great! Thank you very much!

    Based on the sample I implemented it this way:

    Add function in the script block :




    function blockBackButton() {
    
    
    History1.add('empty');
    
    
    }
    The onready event must call blockBackButton() once..

    In the ASPX block :




    <ext:History ID="History1" runat="server" >
    
    
    <Listeners>
    
    
    <Change Fn="blockBackButton" />
    
    
    </Listeners>
    
    
    </ext:History>
    Last edited by Daniil; Sep 21, 2012 at 6:27 AM. Reason: Please use [CODE] tags
  6. #6

    RE: [CLOSED] Back button

    I just tested with Google Chrome and my solution does not work. I think that change event is never raised. Do you have any idea why? I work with Internet Explorer, Firefox and Safari and it works well.

    Thanks.




  7. #7
    Quote Originally Posted by Jean-Pierre Poulin View Post
    I just tested with Google Chrome and my solution does not work. I think that change event is never raised. Do you have any idea why?
    Hi,

    I just tested the page below. Yes, it works well in IE9 and FireFox. Also it partially works in Chrome. "Partially" means the following. If I open a new tab and load this page, then it seems don't work, i.e. an empty page is opened after clicking the Back button. If I open some other page first, then open my page, then it works well.

    Looking this issue up on the internet might help to find some solution for Chrome.

    Example
    <%@ Page Language="C#" %>
     
    <%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
    
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
     
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
        <title>Ext.NET Example</title>
    
        <script type="text/javascript">
            var blockBackButton = function () {
                History1.add("empty");
            };
        </script>
    </head>
    <body>
        <form runat="server">
            <ext:ResourceManager runat="server">
                <Listeners>
                    <DocumentReady Handler="blockBackButton();" />
                </Listeners>
            </ext:ResourceManager>
    
            <ext:History ID="History1" runat="server" >
                <Listeners>
                    <Change Fn="blockBackButton" />
                </Listeners>
            </ext:History>
    
            Try to "Back"
        </form>
    </body>
    </html>

Similar Threads

  1. Replies: 6
    Last Post: Jan 08, 2012, 4:06 AM
  2. [CLOSED] Block navigation with browser's back & forward button
    By RomualdAwessou in forum 1.x Legacy Premium Help
    Replies: 3
    Last Post: Nov 08, 2010, 3:35 PM
  3. back forward button autoload web site example
    By BLOZZY in forum 1.x Help
    Replies: 0
    Last Post: Sep 15, 2010, 11:36 AM
  4. How to not break the back button inside a viewport?
    By netwearcdz in forum 1.x Help
    Replies: 0
    Last Post: Oct 22, 2009, 6:58 PM
  5. Browser back button
    By peterdiplaros in forum 1.x Legacy Premium Help
    Replies: 4
    Last Post: Nov 21, 2008, 11:24 AM

Tags for this Thread

Posting Permissions