Asp – Strongly Typed Views in ASP MVC

asp.net-mvc

I have been looking through Scott Guthrie's MVC tutorials and it seems like the syntax for doing strongly typed views has changed, or I am doing something wrong…

My controller code:

return View(CurrentUser);

Code behind in the view:

    public partial class EditProfile : ViewPage<User>

Yet in the view's front end code if I type

ViewData.

I dont get any intellisense for the properties available in my User class at all, in fact it looks like a list of methods available in IEnumerable

Someone please put me out of my misery 🙂

Best Answer

ViewData.Model

you were so close :)