Persist RadPane ContentUrl on Refresh

4 posts, 0 answers
  1. Brad Bamford
    Brad Bamford avatar
    14 posts
    Member since:
    Feb 2008

    Posted 17 Feb 2011 Link to this post

    I have a simple page setup with two horizontal panes.

    1 Header Pane - with a RadMenu Control
    1 Content Pane

    When a user clicks on a rad menu link it loads the corresponding page into the ContentPane.
    This works great until the user clicks refresh on the browser and the ContentPane loads the inital page instead of the last page the user was on.

    Can the ContentUrl be persisted on a page refesh?
    If not, should I build some type of cookie system that will hold the users' last contentURL or is there a better way?

    Thanks,

    Brad
  2. Niko
    Admin
    Niko avatar
    387 posts

    Posted 22 Feb 2011 Link to this post

    Hello Brad,

    Could you, please, elaborate on the way you are changing the ContentUrl of the content pane? I did some tests using the setup you described and the ContentUrl was persistent on page refresh (through F5 or similar). You can find this implementation in the attached sample project.

    All the best,
    Nikodim
    the Telerik team
    Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Brad Bamford
    Brad Bamford avatar
    14 posts
    Member since:
    Feb 2008

    Posted 08 Mar 2011 Link to this post

    Thanks for the reply.
    However, your example is only sort of maintaing state because you are using asp:linkbuttons.
    There's a postback that is occuring, and the refresh is just reissuing the last postback. It isn't really maintaing the ContentURL state of RadPane. If you do a search in bing and then refresh the page it isn't mainting the last bing search you made.

    Also, the RadMenu that I am using creates standard anchor tags.

    I managed to get this to work using the RadMenu's OnClientItemClicked event to store the URL of the last menu item clicked in a cookie and then reloading it on a page refresh. However, I wish there was an easy way to detect link clicks from within the RadPane. (Bing searches in your example)

    It would be nice if there was a clientside event that would fire from the RadPane such as ContentUrl_Changed, or ContentUrl_LoadComplete. This would provide an easy way to persist the actuall RadMenu URLs.

  5. Niko
    Admin
    Niko avatar
    387 posts

    Posted 11 Mar 2011 Link to this post

    Hello Brad,

    Implementing such an event is impossible due to platform restrictions based on security concerns. Basically working with external content from within one's page is a violation of the Same Origin Policy. The external content itself should remain anonymous otherwise anyone can change it.

    All the best,
    Nikodim
    the Telerik team
    Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
Back to Top