views:

32

answers:

2

I'm an absolute beginner with ASP.NET MVC and I'm trying to build a pretty simple application, but I'm having a hard time getting out of the webforms thinking.

I need to register users so they can download my application. I need to capture their information in three screens. Rather than write the database from each view, I want to aggregate all of the data they enter and let them confirm it before they submit their information.

I've been playing with various models and such but if I make one big model, the scaffolding wants to put all the fields on one view.

Can anyone point me in the right direction?

+2  A: 

ASP.NET MVC is stateless, which means it doesn't save state between views like Webforms does.

You should save the information from each view into the database, and then set a flag in the user's database record at the end, indicating that the user confirmed their information.

If you need three separate views, you can always copy parts of the code created by the scaffolding to each of the three new views, using only those fields you want the user to see in each view.

If you need validation in each view, use a ViewModel object for each view that pertains only to those fields in the associated view.

Robert Harvey

related questions