views:

102

answers:

2

how can i store different data enetered using multiple steps? Its 4-5 step procedure, user can go through each step & at the final submission i want to store it in database. I want to create class to store this data & store the data in object of that class & use it from session. I just want to know what type should i use to store multiple data. i.e. array,ienumrable,list,etc..

Any suggestion or example to implement class like this.

Thanks Pragnesh

+1  A: 

List is generally most useful. If the data items map to specific fields though you could just make them properties in the class (you could use reflection if you wanted to make the code generic).

Alternatively for a wizard you could use the built in wizard control, which stores all the field data in viewstate. This is generally better than storing in session - for example if the user opened two browsers it would get confused.

mike nelson
A: 

Depends on how many data you need to maintain between steps and how many visitors will use the steps concurrently - server resources are limited.

The ways to use:

  • Session state (may be lost, but uses server resources)
  • Viewstate (can't be lost, but uses traffic)

Regarding types to use - use types that are not complex and are compact after serializing, more primitive. Test it.

Viktor Jevdokimov