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
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
Thanks!
Please review the demos and the online documentation.
Regards,
Peter Filipov
Telerik
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
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);
}
}
​
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
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
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