tags:

views:

165

answers:

3

I want to make a sign-up form that spans across 3 pages in ASP.NET MVC.

What method should one use to persist the users answers for the first and second pages before submitting the 3rd page?

Is it done with TempData, Session, or some other method particular to MVC?

Are there any examples of how to do this?

+1  A: 

Steven Sanderson has a worked out example in Pro ASP.NET MVC Framework (pp 396-406). He sends the data to the page or serializes to TempData as required, and uses a pair of custom OnActionExecuting/OnResultExecuted methods to manage it behind the scenes. Inside the controller the data pops up like magic, so it is less transparent than I would like, but shows a basic persistence method that avoids session state.

Keith Morgan
TempData uses SessionState underneath. I REALLY need to get that book.
andymeadows
It's true that TempData is implemented on top of the session store but since the contents are automatically flushed after one request it's much easier to use.
Keith Morgan
A: 

Check out this SO Question.

Design suggestion for passing parameters in MVC

griegs
A: 

I think there are a few criteria you should consider before choosing a solution. Some of these are:

  1. Do you have authenticated users or public (anonymous) users?
  2. How sensitive is the information you're storing between pages?
  3. Are they allowed to go off-line and return later to continue where they left off?
  4. How large is the data you're storing (in total) and how many concurrent users do you anticipate?

These questions will lead you to decisions on where and how to store the data. Once you know that, you can start looking for a good implementation of that storage method.

Bernhard Hofmann
This is the user sign up form, so they will not be authenticated users. The sensitivity of the information will be typical of what many larger websites require when signing up.
KingNestor