Problem with Models on Master Page View.

Posted by user342514 on Stack Overflow See other posts from Stack Overflow or by user342514
Published on 2010-05-16T18:51:24Z Indexed on 2010/05/16 19:10 UTC
Read the original article Hit count: 295

Filed under:

Have a problem with master page views and models.

In the first image, I have a simple view in which I am trying to access the Model properties. None of the model properties are available at this time (this is the problem).

If I use a <%= Model.blah %> then you can see that the model properties are available. Second photo.

In the last photo you will now see that I can access the Model properties that I was trying to access in the first photo.

An error will be thrown if viewing this page if you don't first do <%= with the model. CS1061: 'object' does not contain a definition for 'User' and no extension method 'User' accepting a first argument of type 'object' could be found (are you missing a using directive or an assembly reference?)

http://yfrog.com/8b43656447p

So why is this happening?

© Stack Overflow or respective owner

Related posts about asp.net-mvc