Session Variable

Sep 30, 2008 at 9:56 AM
Hi,

Is there a way I could use session variables within widgets?

Regards

Sep 30, 2008 at 10:34 AM
Hello,$0$0$0$0Yes, you could use session variables within widgets as you would use session variables in a classic ASP.NET website : configure it in the default.aspx and use them in the .ascx.cs in your widgets, there's no problem with this (I use session variable on my implementation of dropthings)$0
Sep 30, 2008 at 10:39 AM
Hi,

Thanks for the reply.

But I have no luck. I keep getting an error:

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.


I have added enableSessionState = "true" to the page tag and I have added <add name="Session" type="System.Web.SessionState.SessionStateModule"/>  to my httpModules, but still gets the same error?

Sep 30, 2008 at 10:40 AM
Edited Sep 30, 2008 at 10:44 AM
edit : sorry, I've half-readed your comment !$0$0$0$0do you add the enableSessionState = "true" to the default.apsx ? I haven't use your code in httpModules, I will post you my code in the ascx.cs of my widget to show you how I used it$0
Sep 30, 2008 at 10:45 AM
Thanks Pilosite!

After I changed the enableSessionState = "true" on the Default.aspx it worked!

Regards