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

Technqiue to allow user's to bookmark ajax based pages and save the page's state

1 Answer 33 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
mitchell
Top achievements
Rank 1
mitchell asked on 20 Sep 2010, 07:06 PM

Our application uses a telerik ajax tab strip.    It has three tabs, known as section1,section2 and section3.  Since the tab strip is ajax based the state of it, is not known on the server.

At any point, the user can choose to bookmark the page.   When the user loads that bookmarked page, they expect to return to a screen with the tab showing the same tab "selection" as when the bookmark occurred.

Question 1: is there any built capability in telerik to accomplish this?

One way to accomplish this is to use HTML anchors.  

Each time the user click on a different tab we can execute custom javascript to change the page's url to contain this anchor. So when the user clicks on the tab named "section2" we change the url from

http://localhost/page.aspx

to this.

http://localhost/page.aspx#tab=section2

Now, when we change the pages url, the browser does not submit the page for a reload.  This is because, i believe,  the anchor is entirely processed on the client side.  The server never even sees anything after the # in the request..  The browser must strip our everything after the # when it passes the URL to the server.

To be specific, as far as the server is concerned these urls all point to the same location

http://localhost/page.aspx
http://localhost/page.aspx#tab=section1
http://localhost/page.aspx#tab=section2

and therefore the browser does not need to resubmit the url when the client side javascript changes the anchor. 

So far, that nuanced behavior is working in our favor.  The problem is: when the page is reloaded from the bookmark.  Now its the client side code responsibility to switch from the first tab which is section1 to section2 which is in the bookmark.

Question 2: Are all of my assumptions correct?  Are anchors always ignored by the browser?  Does this work reliably across all browser?

Question 3:  Is there a better way to accomplish the same thing without using anchors?

Question 4: If it were just a single tab it would be simple, but there are actually more components involved.   Are there any tools that can help us update all of the controls based on the contents of the anchor line?





 

1 Answer, 1 is accepted

Sort by
0
Iana Tsolova
Telerik team
answered on 21 Sep 2010, 11:11 AM
Hi mitchell,

We have no built-in features for this functionality. However you can easily achieve it by implementing the history through the ScriptManager control. Find more information in the below articles:

http://dotnetslackers.com/articles/aspnet/AFirstLookAtASPNETExtensions35HistoryPoints.aspx
http://msdn.microsoft.com/en-us/library/cc488548.aspx


Kind regards,
Iana
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
General Discussions
Asked by
mitchell
Top achievements
Rank 1
Answers by
Iana Tsolova
Telerik team
Share this question
or