Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6118779
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T15:28:34+00:00 2026-05-23T15:28:34+00:00

I have created a List objects when application starts and saved them as a

  • 0

I have created a List objects when application starts and saved them as a session variable.

I then use this session variable throughout life of the application.

At times I update to this List in other layers of the application so I want to pass this session variable to other layers.

Should I be passing List object from asp.net to other layers in the methods? should i create a property of List in all layers which are going to use this object and set the property from the presentation layer? if i create a static list then all users see same list. i want the list to be session specific.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T15:28:34+00:00Added an answer on May 23, 2026 at 3:28 pm

    Do not send a session object to your data layers or other business logic. One of the primary reasons for even separating those things out is so that you can reuse the code in other programs.

    As soon as you add a dependency, like on HttpContext, then you may as well not have those layers and just throw it all together.

    Regarding the list itself, when you need to pass the data to the business / data layers send it as a List.

    Finally, I would suggest that unless that list is used on a large number of the pages that you don’t put it in session at all and instead just pull the data from the database whenever it’s needed. Session data has to be serialized and deserialized on each page access. This adds processing overhead. It gets worse if your app is in a load balanced environment because the session data would have to be pushed and pulled across the network wire for every page access whether or not it was used… which neatly takes away any reason for having it in session anyway.

    However, if the data is used in most places then I’m really curious as to what it is. Session shouldn’t be used as a dumping ground for a bunch of objects. And I’m really hoping you are not trying to store things like datasets, command objects, or anything like that.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hai Friends, I have created an sample application, in which i have a list
We have created a new List View Style that shows thumbnails from a picture
I have a regex created from a list in a database to match names
I have a Silverlight application which loads about 2000 objects of half a dozen
I have a MainViewModel and Customers property (list of CustomerViewModel objects as an ObservableCollection)
Can anybody tell me why is this not working. I have created a WCF
I have multiple business objects in my application (C#, Winforms, WinXP). When the user
in WPF application I load a list of business objects by WCF to a
I have found this example on StackOverflow: var people = new List<Person> { new
I have a field object and I create a list of fields: class Field

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.