PersistStateInCookie and redirect

9 posts, 0 answers
  1. CSurieux
    CSurieux avatar
    465 posts
    Member since:
    Jan 2007

    Posted 04 Dec 2008 Link to this post

    Hello,

    I am using sucessfully PersistStateInCookie between pages of my site but in some special cases the response is redirected in code behind and I get a page with my old page-item selected in PanelBar.
    I have seen the code library on this point but I am not satisfyed with solutions of adding something in query string (already heavilly loaded).
    Cookie seems top be the best approach but I need to be able to fix it before my response.redirect, how to do this ?
    Is there some internal API I could use, deriving a class from PanelBar and calling it with the new item I want to select ?

    Thanks for help...again.

    CS
  2. Atanas Korchev
    Admin
    Atanas Korchev avatar
    8462 posts

    Posted 04 Dec 2008 Link to this post

    Hi Christian Surieux,

    Unfortunately there is no API which you can use to tweak the cookie value on the server side. Using query string arguments seems to be the only workaround for the time being.

    Regards,
    Albert
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. CSurieux
    CSurieux avatar
    465 posts
    Member since:
    Jan 2007

    Posted 04 Dec 2008 Link to this post

    Alber,

    Thanks for answer, but it is no helpfull in my case.
    So changing selected item before redirect gives no opportunity changing the cookie serverside, what a pity :)
    Hope that this is on the todo list for panelbar, it seems easy to implement when using the cookie, but I don't want to do it by myself as I have seen that the cookie format has already been changed in the past.

    I have another problem: in an ajaxifyed (RadAjaxaManager) button click, I must rebuild all my panelBar content, and, as it is not a binding but a 'manual' adding of items, I need a way to reset all the content already installed in Onload. I tryed Items.clear() but I get problems: the radPanel get inactive after callback ?
    Ajax seems to work because other controls implied in the ajax call are correctly set, only radpanel get destroyed.
    I think it is my reset using item.clear which is not perfect, should I call any other api before rebuilding the radPanel ?

    CS
  5. Atanas Korchev
    Admin
    Atanas Korchev avatar
    8462 posts

    Posted 04 Dec 2008 Link to this post

    Hi Christian Surieux,

    The Clear method of the Items collection is the official way of clearing panel items. What do you mean by saying the the panelbar is inactive after Ajax? Are there any JavaScript errors?

    Regards,
    Albert
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  6. CSurieux
    CSurieux avatar
    465 posts
    Member since:
    Jan 2007

    Posted 04 Dec 2008 Link to this post

    No javascript error but I have to investigate further in my code, could you confirm that PanelBar could used as  the updated control in an ajaxsetting added in codebehind during OnPrerender ?

    Thanks
    CS
  7. Atanas Korchev
    Admin
    Atanas Korchev avatar
    8462 posts

    Posted 04 Dec 2008 Link to this post

    Hi Christian,

    Yes, I confirm. Please open a support ticket and send us your project in case you are not able to resolve the problem by yourself.

    Regards,
    Albert
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  8. CSurieux
    CSurieux avatar
    465 posts
    Member since:
    Jan 2007

    Posted 04 Dec 2008 Link to this post

    Hello Albert,

    Error was in my javascript.
    Could you confirm that after an ajax callback, the document elements which correspond to controls to be updated are destroyed and recreated ?
    Seems to be the reason causing my problem: before the ajax call, I attach an handler to onclick on an image object found with $get, so if  the image object is recreated after ajax call, it looses its on click handler ?

    One last question, what happens to the replaced elements ?
    To be more explicit, I attached a Telerik.Web.UI.Slide object to an element which is replaced after call back: what happen to this Slide object, is it still present in browser memory ? How to clean it ?

    And what if the javascript was using objects refreshed and object not refreshed, all part of a same composite control ?
    How to be sure that the javascript for this control is correctly reloaded as only one part of the composite is refreshed ?

    This became a question more AjaxManager oriented ...

    Thanks for answer.
    CS
  9. Atanas Korchev
    Admin
    Atanas Korchev avatar
    8462 posts

    Posted 04 Dec 2008 Link to this post

    Hello Christian Surieux,

    The question is actually ASP.NET Ajax oriented :) Anyway - indeed after ajax updates all affected elements are destroyed. You need to reattach all event handlers after the ajax update finishes. You can use the endRequest client-side event to do that.

    Regards,
    Albert
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  10. CSurieux
    CSurieux avatar
    465 posts
    Member since:
    Jan 2007

    Posted 04 Dec 2008 Link to this post

    Yes ASP.NET Ajax is just a little ...heavy baby :)
    I will give a look to enrequest, thanks.

    CS
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017