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

RadPersistenceManager Custom Save Location

1 Answer 193 Views
Persistence Framework
This is a migrated thread and some comments may be shown as answers.
Sean
Top achievements
Rank 1
Sean asked on 10 Sep 2013, 07:13 PM
I need to be able to save the persistence data to a custom directory, 
other than the default: ~\AppData

RadPersistenceManager1.CustomLocation = ConfigurationManager.AppSettings["UserPersistenceData"];
RadPersistenceManager1.StorageProviderKey = SessionID.Value;        
RadPersistenceManager1.SaveState();

1 Answer, 1 is accepted

Sort by
0
Peter Filipov
Telerik team
answered on 13 Sep 2013, 11:35 AM
Hi Sean,

You need to implement custom storage provider. Here is an example how it could be achieved:
public class CustomStorageProvider : Telerik.Web.UI.PersistenceFramework.IStateStorageProvider
{
    public void SaveStateToStorage(string key, string serializedState)
    {
           // Save the serialized state somewhere
    }
 
    public string LoadStateFromStorage(string key)
    {
        return "The saved state";
    }
}
 
.....
    protected void Page_Load(object sender, EventArgs e)
    {
....
        RadPersisterManager1.StorageProvider = new CustomStorageProvider();
....    
    }



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 the blog feed now.
Tags
Persistence Framework
Asked by
Sean
Top achievements
Rank 1
Answers by
Peter Filipov
Telerik team
Share this question
or