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

RadPersistenceManagerProxy

11 Answers 222 Views
Persistence Framework
This is a migrated thread and some comments may be shown as answers.
Bill O'Neil
Top achievements
Rank 1
Bill O'Neil asked on 23 May 2013, 11:35 AM
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

11 Answers, 1 is accepted

Sort by
0
Peter Filipov
Telerik team
answered on 28 May 2013, 01:43 PM
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.
0
TonyG
Top achievements
Rank 1
answered on 07 Jan 2014, 09:08 PM
Came here with the exact same question.
Thanks!
0
John
Top achievements
Rank 1
answered on 23 Jul 2015, 11:00 PM
Can we get some examples on the Persistence Framework:  Where to load from ... Where to save to, on a per User basis?
0
Peter Filipov
Telerik team
answered on 24 Jul 2015, 02:26 PM
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
0
John
Top achievements
Rank 1
answered on 24 Jul 2015, 05:02 PM
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?  
0
Peter Filipov
Telerik team
answered on 29 Jul 2015, 10:57 AM
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
0
John
Top achievements
Rank 1
answered on 10 Aug 2015, 09:35 PM
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.  
0
John
Top achievements
Rank 1
answered on 11 Aug 2015, 10:59 PM

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);
    }
}

​

0
Ivan Danchev
Telerik team
answered on 13 Aug 2015, 01:33 PM
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
0
ankita
Top achievements
Rank 1
answered on 01 Jun 2016, 04:42 PM

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

0
Ivan Danchev
Telerik team
answered on 03 Jun 2016, 01:01 PM
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.
Tags
Persistence Framework
Asked by
Bill O'Neil
Top achievements
Rank 1
Answers by
Peter Filipov
Telerik team
TonyG
Top achievements
Rank 1
John
Top achievements
Rank 1
Ivan Danchev
Telerik team
ankita
Top achievements
Rank 1
Share this question
or