RadPersistenceManager Custom Save Location

2 posts, 0 answers
  1. Sean
    Sean avatar
    1 posts
    Member since:
    Apr 2011

    Posted 10 Sep 2013 Link to this post

    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();
  2. Peter Filipov
    Admin
    Peter Filipov avatar
    1028 posts

    Posted 13 Sep 2013 Link to this post

    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.
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top