5

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?

3 Answers 3

3

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.

Sign up to request clarification or add additional context in comments.

2 Comments

TempData uses SessionState underneath. I REALLY need to get that book.
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.
0

Check out this SO Question.

Design suggestion for passing parameters in MVC

Comments

0

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.

1 Comment

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.