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

Using Session State in Custom Editor Dialogs

6 Answers 158 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Telerik Admin
Top achievements
Rank 1
Iron
Telerik Admin asked on 23 Oct 2008, 07:42 AM
Starting with version 2008.2.1001, the RadEditor control no longer requires Session State to be activated in the web application. This was done in order to allow the editor to work in all application scenarios. As a result of this change, if you have customized one of the editor dialogs and are using the Session object in the code, the dialog will stop working after you upgrade to the latest release. You might see an exception with the following text:

Session state can only be used when enableSessionState is set to true, either in a configuration file or in the Page directive. Please also make sure that System.Web.SessionStateModule or a custom session state module is included in the <configuration>\<system.web>\<httpModules> section in the application configuration.

If you experience this problem, you should see the following KB article on the subject, which provides guidance how to solve it: Using Session State in Custom Editor Dialogs.

Best regards,
The Telerik team

6 Answers, 1 is accepted

Sort by
0
Varun
Top achievements
Rank 1
answered on 27 Oct 2008, 10:23 PM
Hi,
I have encountered this problem but am having difficulty applying your solution. In your example, am I expected to be able to access the Session object from the "SessionStateDialogHandler" class?

In my application, I am using a custom FileBrowserContentProvider for Image Manager, Document Manager etc and I need to be able to access Session from my content provider class.

Could you advise me on how this can be done? At this stage, the code is too large and complex for me to condense and share. I can share details only by word. So I hope the question was clear.

Thanks,
Varun
0
Lini
Telerik team
answered on 28 Oct 2008, 09:10 AM
Hi Varun,

The SessionStateDialogHandler class is the only one you need to add in your application. This class is then used to handle the dialog request. The content provider is instantiated inside the dialog so the changed handler will affect it as well. You should have access to the Session object in your custom content provider if you are using the workaround we posted here.

Regards,
Lini
the Telerik team
.
Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Varun
Top achievements
Rank 1
answered on 28 Oct 2008, 06:54 PM
Hi Lini,

I have solved my problem and for the benefit of others who had the same issue, here is what I did:

I combined the information in your workaround with the contents of this article: http://msdn.microsoft.com/en-us/library/46c5ddfy.aspx

What I overlooked was that for IIS 7, it is necessary to register the http handler under <system.webServer> in the web.config file in addition to the <httpHandlers> element mentioned in your KB article.

Perhaps you could incorporate this so as to complete the current KB article.

You were right: this enabled access to Session in the content provider as well.

Regards,
Varun
0
Lini
Telerik team
answered on 29 Oct 2008, 07:24 AM
Hi Varun,

Thanks for the feedback. I think the KB already includes separate snippets for IIS 7 and IIS 6 <httpHandlers> sections. I will make sure that it is more clear in the text where the change should be made.

All the best,
Lini
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
JohnC
Top achievements
Rank 1
answered on 18 Nov 2008, 12:40 AM
Link to workaround article is broken and forums are only showing the month and the day so I can't tell how old this information is but I'm guessing it's over a year if the link to the article is broken already?
0
Rumen
Telerik team
answered on 18 Nov 2008, 03:24 PM
Hi John,

The KB article was not accessible for a while. Please, try the following link which should work properly:

http://www.telerik.com/support/kb/aspnet-ajax/editor/session-in-dialogs.aspx


Best regards,
Rumen
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
Editor
Asked by
Telerik Admin
Top achievements
Rank 1
Iron
Answers by
Varun
Top achievements
Rank 1
Lini
Telerik team
JohnC
Top achievements
Rank 1
Rumen
Telerik team
Share this question
or