RadPersistenceManagerProxy

12 posts, 0 answers
  1. Bill O'Neil
    Bill O'Neil avatar
    111 posts
    Member since:
    Nov 2004

    Posted 23 May 2013 Link to this post

    I want to start using the Persistence Framework - in a complex project that uses many usercontrols and MasterPages.

    Logic (and what documentation I see) demands that we add the RadPersistenceManager to the MasterPage and use RadPersistenceManagerProxy to add settings.  

    I'm trying to determine how to SAVE and LOAD settings from the .aspx/.ascx pages that use the RadPersistenceManagerProxy.  The proxy doesn't seem to have the SAVE and LOAD methods.  Do I need to find/create a reference to the actual RadPersistenceManager?  Or can I use the proxy to trigger these events?

    (For what its worth - I want to trigger LOAD on Page_Load (if settings exist) and I want to add a ImageButton on the .aspx/ascx to allow the user to make the changes they want and then save them.)

    Bill
  2. Peter Filipov
    Admin
    Peter Filipov avatar
    1028 posts

    Posted 28 May 2013 Link to this post

    Hi Bill,

    You could access the RadPersistenceManager in the user control after init_complete phase and call the load and save methods. E.g.:
    protected override void OnLoad(EventArgs e)
    {
        base.OnLoad(e);
        var persistenceManager = RadPersistenceManager.GetCurrent(Page);
    }


    Regards,
    Peter Filipov
    Telerik
    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. UI for ASP.NET Ajax is Ready for VS 2017
  4. TonyG
    TonyG avatar
    239 posts
    Member since:
    Feb 2006

    Posted 07 Jan 2014 Link to this post

    Came here with the exact same question.
    Thanks!
  5. John
    John avatar
    43 posts
    Member since:
    Aug 2014

    Posted 23 Jul 2015 in reply to Peter Filipov Link to this post

    Can we get some examples on the Persistence Framework:  Where to load from ... Where to save to, on a per User basis?
  6. Peter Filipov
    Admin
    Peter Filipov avatar
    1028 posts

    Posted 24 Jul 2015 Link to this post

    Hi John,

    Please review the demos and the online documentation.

    Regards,
    Peter Filipov
    Telerik
    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 Feedback Portal and vote to affect the priority of the items
  7. John
    John avatar
    43 posts
    Member since:
    Aug 2014

    Posted 24 Jul 2015 in reply to Peter Filipov Link to this post

    Thanks, Peter.  The demo, that you referenced, shows how to implement the Persistence Framework in a web page sans Master Page.  My web app has a Master Page plus content pages.  In Telerik documentation elsewhere, it was recommended that the RadPersistenceManager be implemented in the Master Page and the RadPersistenceProxyManager be implemented in the content pages.  If that is not correct, please advise me on best practices on how best to implement the Persistence Framework when a Master Page is utilized.  If that is correct, are there good examples somewhere of code in implementing the RadPersistenceProxyManager in code-behind?  
  8. Peter Filipov
    Admin
    Peter Filipov avatar
    1028 posts

    Posted 29 Jul 2015 Link to this post

    Hello John,

    We have no examples showing how to use the proxy in the content pages. You need only to declare it and configure it in the same manner as in a stand alone page.  

    Regards,
    Peter Filipov
    Telerik
    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 Feedback Portal and vote to affect the priority of the items
  9. John
    John avatar
    43 posts
    Member since:
    Aug 2014

    Posted 10 Aug 2015 in reply to Peter Filipov Link to this post

    RadPersistentManager & Proxy simply don't work!  The Forum and StackOverflow have many of my same complaints.  The View State  for my Page, containing RadTabStrip and (3) RadGrids, gets stepped on in Page_Load/Unload.  I get erratic LoadState results.  If I use buttons, instead of Page_Load/Unload, it doesn't always load all changed expressions.  If the filter criteria values load, it doesn't refresh the scoping of my grid upon ReBind().  So, Persistence is still just a dream... maybe someday.  
  10. John
    John avatar
    43 posts
    Member since:
    Aug 2014

    Posted 11 Aug 2015 in reply to Peter Filipov Link to this post

    I need to back peddle, just a bit here.  Apparently, my erratic behavior (on-screen) was self-inflicted.  My Page_Load, Page_Unload, and subsequently, button Clicked event code, was suffering from too much logic, as to when to fire LoadState or SaveState.  It was  tepping on itself.  Here's the (simplified) code that's working for me now ...

     

     protected void Page_Load(object sender, EventArgs e)

    {
        string theKey = "TelerikAspNetRadControlsPersistedState";
        theKey = "StorageProvider_" + Session["UserName"].ToString();
        RadPersistenceManager​1.StorageProviderKey = theKey;
        var fileNameAndPath = Server.MapPath("~/App_Data/" + theKey);

        if (File.Exists(fileNameAndPath) )
        {
            try
            {
                RadPersistenceManager​1.LoadState();
            }
            catch (Exception theError)
            {
                Console.WriteLine("Exception for RadPersistenceManager LoadState: {0}", theError);
            }
        }

    }

    protected void Page_Unload(object sender, System.EventArgs e)
    {
        try
        {
            RadPersistenceManager1.SaveState();
        }
        catch (Exception theError)
        {
            Console.WriteLine("Exception for RadPersistenceManager SaveState: {0}", theError);
        }
    }

  11. Ivan Danchev
    Admin
    Ivan Danchev avatar
    831 posts

    Posted 13 Aug 2015 Link to this post

    Hello John,

    Thank you for getting back to us. I am glad you managed to solve the issue and the Persistence Framework is working as expected.

    Regards,
    Ivan Danchev
    Telerik
    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 Feedback Portal and vote to affect the priority of the items
  12. ankita
    ankita avatar
    5 posts
    Member since:
    May 2016

    Posted 01 Jun in reply to Peter Filipov Link to this post

    Hi Peter,

    I went through almost all examples and documentation available for persistence manager proxy but none solved my problem.

    Could you help me with the problem posted in below thread .Thanks in advance-

    http://www.telerik.com/forums/persistencemanager-proxy-not-working

  13. Ivan Danchev
    Admin
    Ivan Danchev avatar
    831 posts

    Posted 03 Jun Link to this post

    Hello Ankita,

    I see there is an ongoing communication in the thread you started about your problem. I would suggest to continue the discussion in it, in order to keep the threads consistent and avoid duplication.

    Regards,
    Ivan Danchev
    Telerik
    Do you need help with upgrading your ASP.NET AJAX, WPF or WinForms projects? Check the Telerik API Analyzer and share your thoughts.
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017