Any difference between ViewData.Model and return View(model) syntax?

Any difference between ViewData.Model and return View(model) syntax?

Old forum URL: forums.lhotka.net/forums/t/11524.aspx


richardb posted on Friday, August 10, 2012

I notice in the ProjectTracker sample, the code does this in the MVC3UI project.

ViewData.Model = ProjectList.GetProjectList();
return View();

Can we also return the model as a parameter in the View method?

E.g. return View(theModel);

Or is there some nuance with CSLA objects that means ViewData.Model is preferred. Or is this code a bit MVC 2 style still?

Regards,
Richard.

Copyright (c) Marimer LLC