Don't miss out Virtual Happy Hour this Friday (April 26).

Try our conversational search powered by Generative AI!

Preview error in edit mode for media

Vote:
 

I understand that the media type like pdf, excel, images etc are now internally now handled thevery same way as pages or blocks under the umbrella term Content. I don't think pdf uploaded to media in the edit mode of CMS would have a preview for the editor, that should directly take the editor to form editing mode.

This is what is happening in this case but before the user is taken up to form editing mode there is some error populated which I couldn't relate to. Any help is appreciated :)

#173548
Jan 02, 2017 10:59
Vote:
 

Hello Amol

The error appears to be connected to session state. Some parts of the Episerver UI require session state. Do you have session state enabled?

David

#173570
Jan 02, 2017 19:22
Vote:
 

Well, I believe Episerver edit mode is using ASP.net cookie based session to work , looking at the config I see <sessionState mode="InProc" timeout="60" /> , InProc mode is enabled.

Just to give a brief about the customization done in this case, an  HTTP handler is in place, which basically interupts request to media and routes it through a custom controller and view is rendered with the media embedded within it. So the pdf document is rendered on the browser but internally it is an Episerver page which is wrapping the media. This is done to achieve custom header when pdf is directly rendered on the browser. This Http handler expects IRequiresSessionState could this be related to this error?

Behavior is working just as expected in the view mode but in edit mode this error is coming up.

While writing this up ,I tried removing the dependency for IRequiresSessionState in the handler and it did the trick :) I was not getting the session error any more. Now I need to understand ,what was IRequiresSessionState doing in the handler. If nothing is being hampered ,I will commit the change . Job done...

Thanks David, once again

#173573
Jan 03, 2017 6:11
Vote:
 

Perhaps. I celebrated way too early. With localhost , may be the error redirected so early that I couldn't recognize but with real domain in place. The error stayed in for a very long time for me to copy the error message content as well

Exception details: InvalidOperationException: The SessionStateTempDataProvider class requires session state to be enabled.

[InvalidOperationException: The SessionStateTempDataProvider class requires session state to be enabled.]
at System.Web.Mvc.SessionStateTempDataProvider.SaveTempData(ControllerContext controllerContext, IDictionary`2 values)
at System.Web.Mvc.Controller.PossiblySaveTempData()
at System.Web.Mvc.Controller.EndExecuteCore(IAsyncResult asyncResult)
at System.Web.Mvc.Async.AsyncResultWrapper.<>c__DisplayClass4.b__3(IAsyncResult ar)
at System.Web.Mvc.Controller.EndExecute(IAsyncResult asyncResult)
at System.Web.Mvc.MvcHandler.<>c__DisplayClass8.b__3(IAsyncResult asyncResult)
at System.Web.Mvc.Async.AsyncResultWrapper.<>c__DisplayClass4.b__3(IAsyncResult ar)
at System.Web.Mvc.MvcHandler.EndProcessRequest(IAsyncResult asyncResult)
at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)

back to square one :(

#173574
Jan 03, 2017 6:38
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.