This is a migrated thread and some comments may be shown as answers.

Viewstate Navigation RadWindow

3 Answers 56 Views
Window
This is a migrated thread and some comments may be shown as answers.
William
Top achievements
Rank 1
William asked on 05 Apr 2012, 07:38 PM
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.

3 Answers, 1 is accepted

Sort by
0
Marin Bratanov
Telerik team
answered on 06 Apr 2012, 02:20 PM
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.
0
William
Top achievements
Rank 1
answered on 09 Apr 2012, 07:21 PM
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.
0
Marin Bratanov
Telerik team
answered on 10 Apr 2012, 03:37 PM
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.
Tags
Window
Asked by
William
Top achievements
Rank 1
Answers by
Marin Bratanov
Telerik team
William
Top achievements
Rank 1
Share this question
or