Need help with AJAX History Woes

Discussion in 'ASP .Net' started by JT, Jan 7, 2010.

  1. JT

    JT Guest

    AJAX History Points and General Browser Functionality

    I am attempting to retrofit a web application that had a rudimentary,
    yet mostly effective navigation infrastructure that, when properly
    utilized, allowed navigating forward and backward through AJAX states
    and other pages through the use of additional <asp:Button> objects
    labeled "Back" to perform special code for restoring previous states.
    There was an elaborate stack push and pop algorithm for this. The
    effect was very similar to what is described in Diagram 1 (AStatex
    refers to an AJAX related state of the page). The reason for this is
    so that it takes away the reliance on the contrived Back button and so
    that accidentally hitting the browser's back button or hitting the
    Backspace key won't cause a loss of state.

    Diagram 1
    Page1 -> Page2.AState1 -> Page2.AState2 -> Page2.AState3 -> Page3
    Using contrived Back button
    Page3 -> Page2.AState3 -> Page2.AState2 -> Page2.AState1 -> Page1

    The intent is to utilize the ASP.NET 3.5 ability to add history points
    via the bookmarking feature of the browser. I have read a non-trivial
    amount about this technique, however the problem I am experiencing is
    that when either redirecting to a new page, performing a cross-page
    postback, or some other way of leaving a page, the history points
    programatically added for the previous page are now lost, causing the
    previous page's AJAX state history to be lost.

    Referring to Diagram 2, I can return to Page2 with the last state
    restored, as a function of the built-in browser functionality, but if
    I hit the browser's back button again, it takes me back to Page1.

    Diagram 2
    Page1 -> Page2.AState1 -> Page2.AState2 -> Page2.AState3 -> Page3
    Using AJAX History Points, the ScriptManager.OnNavigate method and
    Browser's back button
    Page3 -> Page2.AState3 -> Page1

    I had thought about attempting to use a combination of pushing state
    information onto the original stack object so that it could be
    restored in instances of navigating back to a different page, such as
    Page2 and somehow have all of the browser's history points remaining
    intact for Page2. The problem is that you cannot sporadically (or
    asynchronously) add history points, so even if I had the ability to
    retrieve the history from data popped from the stack, I can't add the
    history points.

    Is there a way to prevent the loss of the previous page's history
    points?

    TIA,

    JT
    JT, Jan 7, 2010
    #1
    1. Advertising

  2. I don't exactly understand what you mean by sporadically and
    asynchronously. In the latter case, all async operations start somewhere.
    And that somewhere is where you add the history point. I'm not sure what you
    mean by sporadically. Bare in mind that ajax history is not enterprise ready
    in my tried opinion.

    --
    Vapordan
    Shameless Author Plug
    ASP.NET 4 by Example only $20
    OWC Blackbook www.lulu.com/owc

    "JT" <> wrote in message
    news:...
    > AJAX History Points and General Browser Functionality
    >
    > I am attempting to retrofit a web application that had a rudimentary,
    > yet mostly effective navigation infrastructure that, when properly
    > utilized, allowed navigating forward and backward through AJAX states
    > and other pages through the use of additional <asp:Button> objects
    > labeled "Back" to perform special code for restoring previous states.
    > There was an elaborate stack push and pop algorithm for this. The
    > effect was very similar to what is described in Diagram 1 (AStatex
    > refers to an AJAX related state of the page). The reason for this is
    > so that it takes away the reliance on the contrived Back button and so
    > that accidentally hitting the browser's back button or hitting the
    > Backspace key won't cause a loss of state.
    >
    > Diagram 1
    > Page1 -> Page2.AState1 -> Page2.AState2 -> Page2.AState3 -> Page3
    > Using contrived Back button
    > Page3 -> Page2.AState3 -> Page2.AState2 -> Page2.AState1 -> Page1
    >
    > The intent is to utilize the ASP.NET 3.5 ability to add history points
    > via the bookmarking feature of the browser. I have read a non-trivial
    > amount about this technique, however the problem I am experiencing is
    > that when either redirecting to a new page, performing a cross-page
    > postback, or some other way of leaving a page, the history points
    > programatically added for the previous page are now lost, causing the
    > previous page's AJAX state history to be lost.
    >
    > Referring to Diagram 2, I can return to Page2 with the last state
    > restored, as a function of the built-in browser functionality, but if
    > I hit the browser's back button again, it takes me back to Page1.
    >
    > Diagram 2
    > Page1 -> Page2.AState1 -> Page2.AState2 -> Page2.AState3 -> Page3
    > Using AJAX History Points, the ScriptManager.OnNavigate method and
    > Browser's back button
    > Page3 -> Page2.AState3 -> Page1
    >
    > I had thought about attempting to use a combination of pushing state
    > information onto the original stack object so that it could be
    > restored in instances of navigating back to a different page, such as
    > Page2 and somehow have all of the browser's history points remaining
    > intact for Page2. The problem is that you cannot sporadically (or
    > asynchronously) add history points, so even if I had the ability to
    > retrieve the history from data popped from the stack, I can't add the
    > history points.
    >
    > Is there a way to prevent the loss of the previous page's history
    > points?
    >
    > TIA,
    >
    > JT
    Alvin Bruney - ASP.NET MVP, Jan 11, 2010
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. minnie
    Replies:
    1
    Views:
    671
    Andrew Thompson
    Dec 13, 2006
  2. Sam Stephenson
    Replies:
    1
    Views:
    215
    Andrew Walrond
    Jun 18, 2005
  3. Replies:
    4
    Views:
    112
  4. Replies:
    2
    Views:
    278
    nutso fasst
    Oct 17, 2006
  5. Niall
    Replies:
    3
    Views:
    157
    Niall
    Dec 6, 2006
Loading...

Share This Page