Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 2.0 > ASP.NET 2.0 Basics
ASP.NET 2.0 Basics If you are new to ASP or ASP.NET programming with version 2.0, this is the forum to begin asking questions. Please also see the Visual Web Developer 2005 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 2.0 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old January 24th, 2007, 08:22 AM
Registered User
Join Date: Jan 2007
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Temporary storage for a items list

Hello, this is my first posting!

I need to allow the user to input a series of items in a temporary way. Users must be able to view, edit and navigate those items. And finally, they should be able to accept them and only then they would be added to my database.

I have been learning ASP.NET by my own since a month ago, but I still consider myself an absolute begginner. I'm afraid I've been trying to do all this in the hard way. First I stored an ArrayList in my session, few time after I discovered I can also define it as a variable inside my page (an attribute, I suppose) and this simplified the code very much but I'm not sure about the difference/relevance of this decision.

Now I'm trying to use, without too much success, an ObjectDataSource with custom Items/Item classes so I can use data aware controls (before this, I had to make my own First/Previous/Next/Last controls from scratch and it was quite painful).

I'm not sure what I should do, I'm sure this is a common situation and there must be a simpler solution.

Old January 24th, 2007, 07:56 PM
Authorized User
Join Date: Apr 2005
Posts: 94
Thanks: 0
Thanked 0 Times in 0 Posts

The first way, session, uses server memory for storage. This is fine if the app is not that big, user base is not too large and the amount of data isn't too great. Reason being is think of 1000 users building a session object for that data and you can imagine how much memory will be used up on the server. I am thinking the other way is using the viewstate. Besides the viewstate, you can also throw it into a cookie.

A dataset is what you are probably thinking of for storage but think of it as a memory variable too. Datasource needs something to connect to like an XML file or database. I would use the session object in ASP.NET. It should be that complicated of code as I just use my session as so:

Session["mysessionvariablename"] = aryMyData;

When I am done, I remove it with:

Memory is not a big issue with session if you clean up what you do not need anymore instead of leaving it active.

Similar Threads
Thread Thread Starter Forum Replies Last Post
how to automate selection of items from list satish_k VB How-To 0 October 6th, 2006 06:44 AM
how to automate selecting all items from list satish_k Pro VB.NET 2002/2003 0 October 3rd, 2006 06:23 AM
fill dropdown list with items when parent list isaac_cm Pro PHP 1 July 10th, 2006 05:41 AM
Auto Select List Items JpJoe Access VBA 2 November 3rd, 2005 01:12 PM
Select Items in List from a String mwn1218 Access VBA 1 February 11th, 2005 11:21 AM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.