473,722 Members | 2,240 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

State Management

Can collection classes be used to store session data? In a couple of books on
ASP.Net where they discuss state management (to capture a user's input data),
they talk about session and application objects, cookies, statebag, etc.

But if I have a checkboxlist, can't I just iterate through the selected
items and store them in a collection class for use in later pages in the web
app? Would there be implications of doing it this way?

Thank you,
Richard
Nov 18 '05 #1
2 1230
The only issue to be aware of (in your collection scenario) is
serialization. If the collection that you put the objects is not
serializable you'll get an exception if someone decides to activate SQL
or Out-Of-Process session state as these session storage methods
serialize the object across process boundaries when storing and
retrieving the data. Of course this assumes that you use session to
temporarily store state.

You mentioned other ways of storing the user data each has its own
issues. You don't want to use the application level storage for
handling the storage of user specific data as you're giving every user
potential access to every other user's data, not to mention that the
data will stick around in memory until the application ends or you take
pains to shut it down. If you are looking at cookies you'll need to
make a call on how much data you want to store and transmit across the
line between the user and the server.

We've found that on the whole using serializable data containers to
store data in Session seems to be the most flexible and manageable
solution to temporary storage of state. We usually abstract the calls
to state storage in a wrapper class so that we can change the storage
methodology as our needs dictate (i.e. custom storage repository,
security requirements... ).

Have A Better One!

John M Deal, MCP
Necessity Software

Richard wrote:
Can collection classes be used to store session data? In a couple of books on
ASP.Net where they discuss state management (to capture a user's input data),
they talk about session and application objects, cookies, statebag, etc.

But if I have a checkboxlist, can't I just iterate through the selected
items and store them in a collection class for use in later pages in the web
app? Would there be implications of doing it this way?

Thank you,
Richard

Nov 18 '05 #2
John, thank you for this info!

"John M Deal" wrote:
The only issue to be aware of (in your collection scenario) is
serialization. If the collection that you put the objects is not
serializable you'll get an exception if someone decides to activate SQL
or Out-Of-Process session state as these session storage methods
serialize the object across process boundaries when storing and
retrieving the data. Of course this assumes that you use session to
temporarily store state.

You mentioned other ways of storing the user data each has its own
issues. You don't want to use the application level storage for
handling the storage of user specific data as you're giving every user
potential access to every other user's data, not to mention that the
data will stick around in memory until the application ends or you take
pains to shut it down. If you are looking at cookies you'll need to
make a call on how much data you want to store and transmit across the
line between the user and the server.

We've found that on the whole using serializable data containers to
store data in Session seems to be the most flexible and manageable
solution to temporary storage of state. We usually abstract the calls
to state storage in a wrapper class so that we can change the storage
methodology as our needs dictate (i.e. custom storage repository,
security requirements... ).

Have A Better One!

John M Deal, MCP
Necessity Software

Richard wrote:
Can collection classes be used to store session data? In a couple of books on
ASP.Net where they discuss state management (to capture a user's input data),
they talk about session and application objects, cookies, statebag, etc.

But if I have a checkboxlist, can't I just iterate through the selected
items and store them in a collection class for use in later pages in the web
app? Would there be implications of doing it this way?

Thank you,
Richard

Nov 18 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
2339
by: Chad Crowder | last post by:
I've taken a look at this article http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnaspnet/html/asp12282000.asp which someone posted a month or so ago regarding setting up SQL server to handle state data. The article references .Net beta, and the file state.sql in the framwork/1.0x directory, but that file doesn't exist for version 1.1.4322. I'm wondering if there's a component that I need to install, or if I need to...
2
2183
by: John A Grandy | last post by:
for high traffic public websites , what are the proven options for session-state storage & management ? is an out-of-process state-server generally preferred over a sql-server ? what are the relevant criteria ? is the primary criteria max expected total storage size (for all active sessions) versus max ram available on the state-server machine ? if ADO.NET objects (such as small DataTables) must be stored in session-state , is any...
1
1373
by: John Grandy | last post by:
Could someone point me in the direction of good discussions on scalable state management solutions? Specifically, pros and cons of following strategies: Strategy 1 : temporary business-objects are implicitly stored in RAM, "permanent" business objects are explicitly stored in SQL-Server Strategy 2 : both temporary and permanent business-objects are implicitly stored in SQL-Server
2
1426
by: geodev | last post by:
Hello, I’m currently writing an asp.net application that will be running on a Windows XP Professional workstation utilising IIS and MSDE Database. At a later date this application will need to run on a Windows Server 2003 IIS web farm utilising either MSDE Database or SQL Server Database. I’m developing this application utilising Microsoft’s Development Environment 2002 version.
13
2444
by: James Hunter Ross | last post by:
We love the ASP.NET "Session" concept and make good use of it. But, getting close to deployment we find we lose sessions far too often, probably due to application restarts, etc. We hope to eliminate these restarts, but we're not sure that can be achieved. (We are exploring who/what might be touching web.config or assemblies or other files in our application, but have found nothing so far.) We have some serious rewriting to do if all...
0
996
by: Shell | last post by:
Hi All, We have an application that uses SQL Server 2000 for State Management data. We previously use to build and deploy this application using ASP.NET Beta 2 version. Now we are using ASP.NET RTM version.With that, we are able to build & deploy the application successfully. But it gives us the error "The Session State information is valid or might be corrupted." while retrieving data from SQL Server. We can see the data stored...
5
2632
by: knyghtfyre | last post by:
Hello, My company is developing a rather large application with .NET 2.0. We are expanding to a server farm and are in the process of converting our application to use an out-of-process session state management with SQL Server. We have ran into a problem with the Session_onEnd event. We know it's not supposed to fire when in an out-of-process mode, but we have a large amount of code that must be executed to clean the session and to
4
1226
by: =?Utf-8?B?Z3V5?= | last post by:
Is this a valid approach to State Management? What I do is define a class 'State' which holds all the objects etc. that I need to store in the Session. I can then get my state object and reference all the objects that I need . Later I can then save my state object back for use later. This makes coding much simpler than storing individual items in the session state but is there a performance hit for working this way?
0
1077
by: kirk | last post by:
I have three events that I have created and manage with timers. Two of the timer event handlers, the last two in the code below, need to reset state management data, if the first event handler fires. My question, is what I have implemented the right way to design state management, or is there maybe a best practice to design this differently? private string szData1 = null; public string Data1 {
0
8863
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8739
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9384
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9238
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9157
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9088
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8052
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6681
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4502
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.