tags:

views:

629

answers:

1

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 :)

+7  A: 
ViewData.Model

you were so close :)

Ben Scheirman
Haha, good work.I had been googling for a good half an hour, scratching my head.
qui
That's because the framework has been out there bigtime but in flux. Lots of demos and info, but probably 80% has changed since preview 1.
Will
@Will yeah its a real problem I think, it's very hard to find reliable resources. I guess this might be one of the reasons why Apple didnt let developers disclose how they did stuff on the iPhone SDK </tangent>
qui
I prefer to be open about things, as long as people either state specifically what version they're running, or commit to updating their samples.Your best bet is to look at an open source project that is up to date. MvcContrib is a good one to look at.
Ben Scheirman