Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeDevelopment and...Development and...Getting StartedGetting StartedSession Object in dnn 5.4Session Object in dnn 5.4
Previous
 
Next
New Post
1/11/2011 9:42 PM
 
I have a major problem. I cannot figure out what is the problem with my session. I did use session object in dnn 5.0 and it works. There aren't giving me errors on session object. But when upgraded to 5.4 it causes a problem. The session seems to lost or just not so stable. cos' it sometimes return nothing sometimes it does return the object i stored in session.

Does anyone of you know what is the problem and solution to it? Any response really is appreciated.

Thank You

p/s: sorry that I do not know where to post my question and post in here.
 
New Post
1/12/2011 9:38 AM
 
Hi Slen, check the key (name) that you store the object into and retrieve from the session.  I am running DNN 5.6 and it works perfectly.  I make a common static name in the controller so I can not fat finger the name

FeatureControler.cs
public static String SelectedCustomerKey = "SelectedCustomers";

// Store in session
 Session[FeatureController.SelectedCustomerKey] = radGridCustomerPool.SelectedItems;

// Retrieve from session
GridItemCollection selectedGridItems = (GridItemCollection)Session[FeatureController.SelectedCustomerKey];



 
New Post
1/12/2011 8:06 PM
 
Yes. All the keys are match. This was able to run on 5.0, but it cannot run on 5.4. I am thinking maybe there are some configuration over the server or dotnetnuke. I am not sure what are the things different between 5.0 and 5.4. in 5.4 there isn't anymore html folder in app_code folder; that's the only different I know.

Thank for the reply. Any idea?

Thanks
 
New Post
1/12/2011 8:51 PM
 
What are you seeing when you try to get the data out of the Session, null? Can you post some code, both the set and get side?
 
New Post
1/12/2011 10:07 PM
 
Yes. It is Null.

These are the example code. I wrote them in vb
Private newfiletype as List(of FileType)

Private sub page_load() .....
....
If Not Page.ispostback then
'Session is remove and reassign...
'but this only happen when the page is first loaded.
'when postback this will not be executed
end if

End Sub

Private sub Add() ... ...handler
Session("ProductCategory.newfiletype") = newfiletype
end sub

Private sub Save ...handlers ..
newfiletype = Session("ProductCategory.newfiletype")
end sub

I think the session is some how late or lost. This is very hard. For what I feel this is like hide and seek. Most of the time, I clicked the session return nothing. from most time of one or two time, it return the object....very strange...it is related to postback maybe ,

Thank You
 
Previous
 
Next
HomeHomeDevelopment and...Development and...Getting StartedGetting StartedSession Object in dnn 5.4Session Object in dnn 5.4


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out