Viewstate Navigation RadWindow

4 posts, 0 answers
  1. William
    William  avatar
    72 posts
    Member since:
    Jun 2011

    Posted 05 Apr 2012 Link to this post

    Looking for a recommendation of the best way to accomplish this: I have a RadWindow that users can use to navigate between a few different pages within the RadWindow. They navigate by clicking ASP HyperLinks.

    What I would like to be able to do is put a "back" button on each page that allows them to return to the previous page. I thought using ViewStates might be a solution, but I'm not sure how to implement it. 

    I appreciate any feedback.
  2. Marin Bratanov
    Admin
    Marin Bratanov avatar
    5811 posts

    Posted 06 Apr 2012 Link to this post

    Hello William,

    Different pages do not share their ViewState. What you can do is to use the browser's history object and its back() method. I have attached a small sample of this. Note that how this works is controlled by the browser. You can replace the RadWindow with a simple iframe and the results will be the same - what is cached, are form values persisted, etc.


    All the best,
    Marin
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
  3. William
    William  avatar
    72 posts
    Member since:
    Jun 2011

    Posted 09 Apr 2012 Link to this post

    I have implemented that code in my application, but I run into a slight issue. When I click on the button the browser tries to return to the previous page, but then ends up just reloading the current page again. I'm not sure if there is something I have to do to prevent that from happening.
  4. Marin Bratanov
    Admin
    Marin Bratanov avatar
    5811 posts

    Posted 10 Apr 2012 Link to this post

    Hi William,

    The history object is very, very limited and rarely works as expected because the main frame and iframes often share it. Also, postbacks sometimes are considered an entry and sometimes not.

     What I would suggest is that you replace the RadWindow with a simple iframe and load you content page in it. Once you are able to get the desired functionality working with it the same approach should work with the RadWindow without modifications (if you are, of course, using the NavigateUrl, if you are using the ContentTemplate the controls are part of the main page and no new page may have been loaded). You may find useful this article, this page and this one as well in working with history in ASP. These are just examples, more information about this is available freely in the Internet.


    Kind regards,
    Marin
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Back to Top