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

Unable to read storage content. Could not find file

9 Answers 219 Views
Persistence Framework
This is a migrated thread and some comments may be shown as answers.
pio
Top achievements
Rank 1
pio asked on 13 May 2015, 11:27 AM

I've used RadPersistenceManager and follow the following guide :

http://demos.telerik.com/aspnet-ajax/persistence-framework/examples/custom-storage-provider/defaultcs.aspx

Everything work fine in my machine and development server, but on  production  the below exception occurred, even the cookie is created on the client machine:

 

Title: xxxx.aspx, xxxxx Method Name:
Unable to read storage content. Could not find file
'C:\inetpub\wwwroot\XXXX\App_Data\TelerikAspNetRadControlsPersistedState'.

Exception:    at
Telerik.Web.UI.PersistenceFramework.AppDataStorageProvider.LoadStateFromStorage(String
key)    at  Telerik.Web.UI.RadPersistenceManager.LoadState()    at GraphicalUserInterface.JobBasket.LoadGridJobBasket()

 

 

The cookie is created on the client machine

 

9 Answers, 1 is accepted

Sort by
0
Daniel
Telerik team
answered on 18 May 2015, 10:52 AM
Hi,

This means that you have not set the cookie storage provider in the code-behind. Please double check that.

Regards,
Daniel
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
pio
Top achievements
Rank 1
answered on 24 May 2015, 07:34 AM

Thanks Daniel,

 

The different between the demo and my example that I need to load the persistence configurations on page load instead of load button. so it seems some times the CookieStorageProvider not initiated in Page_Init, so I added it in page_load instead.

 

Kindly advice if there is no effect in this solution.

0
Angel Petrov
Telerik team
answered on 28 May 2015, 05:48 AM
Hi,

Moving the loading logic as described should not cause an inconsistency in the behavior. Considering the aforementioned I would kindly like to ask you to share with us the markup and code-behind of the page so we could research what may be causing this issue.

Regards,
Angel Petrov
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 30 Jul 2015, 09:32 PM

What Telerik version are you using?  Apparently, 2015Q2 is buggy with respect to the Persistent Framework.  I have two VS Solutions, one running 2014Q2, and one running 2015Q2.  Using copies of the same Content Page and associated code-behind, Persistence works, for me, in 2014Q2; but, not 2015Q2.

 

 

0
Angel Petrov
Telerik team
answered on 04 Aug 2015, 12:44 PM
Hi John,

Could you please elaborate more on what problems are you experiencing? Maybe we can provide a solution for them.

Regards,
Angel Petrov
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 04 Aug 2015, 03:31 PM

To elaborate,I was specifically getting an error upon Build of my web app:  "The name 'RadPersistenceManager1' does not exist in the current context".  The app doesn't complain until I do a Build.  Then, I get the blue squiggly line under RadPersistenceManager1 in code-behind.  In another thread, I found that if I 'View In Browser' the aspx page, I can circumvent the pre-build process.  It then gives me a runtime error:  Unable to read storage content. Could not find file 'c:\...\visual studio 2013\Projects\...\App_Data\TelerikAspNetRadControlsPersistedState'.

 

However, since my last post, I came to realize that it wasn't necessarily a version-difference problem.  RadPersistenceManager worked when I created a new VS Solution, regardless of the Telerik version.  I tried both Q3 2014 and Q2 2015 in the existing Solution and the new test Solution.  I'm not sure what the Persistence Framework did not like about current VS Solution; but, my work-around for now, is to create a fresh VS Solution then add (import) my existing code/projects.

 

 

0
Angel Petrov
Telerik team
answered on 07 Aug 2015, 06:44 AM
Hello John,

In most of the cases problems like the described occur when the CodeBehind is mistaken with CodeFile in the page directive. CodeFile is normally used in Web Sites whereas the CodeBehind in Web Applications(which required a build).

Since you mentioned that you hare resolved the matter I suggest moving the logic inside the new solution which will not throw errors.

Regards,
Angel Petrov
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 07 Aug 2015, 03:54 PM

The Project was originally created as a website, which was recommended early-on by one of the Telerik Support people.  Where, they said that it would be easier to deal with than a web app.  As, such my Page Directives use CodeFile.  Since my last post, I've created a new Solution and moved everything over; it seems to be working fine now, with no runtime errors and no blue squiggly lines.

 

I do have another RadPersistenceManager issue, as it relates to Page_Load/Unload; but, not sure which forum thread to post.  It was recommended to me, on Stack Overflow, to use Page_Load to assign the StorageProviderKey and execute LoadState(), then use Page_Unload to execute SaveState().  I have a RadTabStrip, with (3) tabs, each with a RadGrid.  My PersistenceSettings identify each RadGrid.  If I simply go into the first tab, make a filter or sort change to the grid, close the page, it saves the filter and sort settings, as it's supposed to.  So far, it works great.   Where things go bad and where it gets complicated is when I click to another tab, or select another Sort column, or filter on a second column.  My Page feels that it needs to Page_Load on each of those; therefore, reloading the saved ViewState.  Besides resetting my filter & sort expressions, it's also a performance problem.  I shouldn't  have to go back to the server and pull data again.  It should handle filters & sorts on the client -side...I would think.

 

So, two questions ...

1) How can I reduce the number of client/server round-trips on a page with multiple tabs & grids?

2) What is Telerik's recommended way of when/where/how to execute LoadState & SaveState?

 

Thanks in advance.

-john-

 

0
Angel Petrov
Telerik team
answered on 12 Aug 2015, 08:03 AM
Hi John,

Regarding to the queries.
  1. Generally if you do not set the RenderSelectedPageOnly property of the multi page to false the controls inside the multi-pages will be initialized and by switching the tabs you should not initiate a postback. As for reducing the grid postbacks you can modify the control logic so that client-side binding is used. That way complex operations such as filtering, sorting and etc will not cause a round-trip to the server.
  2. There is no guideline that one can follow. One can save load the settings according to its requirements. As long as the control can recreate correctly when loading the settings all should be working fine. The general solution indeed would be the use the page load/unload events which are fired when the page initialized(early enough to load the settings) and when the controls are fully initialized(to save the settings).

Regards,
Angel Petrov
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
Tags
Persistence Framework
Asked by
pio
Top achievements
Rank 1
Answers by
Daniel
Telerik team
pio
Top achievements
Rank 1
Angel Petrov
Telerik team
John
Top achievements
Rank 1
Share this question
or