Best method of collecting/storing info over a number of pages

Posted on 2005-04-25
Medium Priority
Last Modified: 2010-04-07
I have a number of pages each containing a form.

I want to collection information from each form and at the end of the process, after completing the last form, write the data into a database.

What is the best way to store the information as the user goes from page to page?

Question by:gilkesy

Accepted Solution

garthjh earned 500 total points
ID: 13862884
Well, depends on what you're most comfortable with, how much data you want to pass and how many forms you want to go through.

A lot of programmers will use session variables, which works for a few items, is unique to the user and is pretty flexible.

So, on the first page assign values

Session.Item("formtextValue1") = formitem.text 'value in a text box
Session.Item("formddlValue1") = formddl.selectedvalue 'value in a ddl

Then, those values can be used throughout your application, including creating your SQL insert--Just keep adding session variables.  The session variables will get destroyed if they close their browser or the session times out before you write to the DB.

Depending on the complexity of your application, you may also consider writing to the DB as you go.  For example, on the first page, write the bits you have collected to your table (including some unique ID), then on the next page, either insert/update the record until you have collected everything you need.  The good thing about this is that you can either resume a set of forms if they leave or get disconnected and you can see where people are abandoning the app, and possibly follow up with them to finish it.  Also, if you need to look at the values at the end of your app, you just pull from the DB instead of session.

Hope that helps.

Expert Comment

ID: 13862915
I agree with the above techniques and generally use session variables myself (assuming you don't need to store a large amount of data or store the data for a long time, as this will drain your server memory, especially for large array list and other collections).

Just to add onto his answer though, instead of writing to a database, you can always use cookies (although some people don't have them enabled, this is a rarity).  This is a much faster method and requires no server-side storage and it has most of the benefits of storing on a database.

Author Comment

ID: 13864467
Ok, thanks!

I will use session variables this time and may explore cookies at a later date.


Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article discusses the ASP.NET AJAX ModalPopupExtender control. In this article we will show how to use the ModalPopupExtender control, how to display/show/call the ASP.NET AJAX ModalPopupExtender control from javascript, how to show/display/cal…
Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
Integration Management Part 2
Whether it be Exchange Server Crash Issues, Dirty Shutdown Errors or Failed to mount error, Stellar Phoenix Mailbox Exchange Recovery has always got your back. With the help of its easy to understand user interface and 3 simple steps recovery proced…
Suggested Courses

864 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question