It seems to me that you have an untyped view. By default, Razor views in MVC3 RC are typed as dynamic
. However, lambdas do not support dynamic members. You have to strongly type your model. At the top of your view file add
@model SampleModel
More Related Contents:
- Cascading drop-downs in MVC 3 Razor view
- ASP.NET MVC View Engine Comparison
- How do I write unencoded Json to my View using Razor?
- How to use jquery or ajax to update razor partial view in c#/asp.net for a MVC project
- Replace line break characters with in ASP.NET MVC Razor view
- Add CSS or JavaScript files to layout head from views or partial views
- Using MVC HtmlHelper extensions from Razor declarative views
- Razor View throwing “The name ‘model’ does not exist in the current context”
- Saving Many to Many relationship data on MVC Create view
- ASP.NET MVC 3 Razor – Adding class to EditorFor
- MVC Razor @foreach
- Can Razor views be compiled?
- How can I load Partial view inside the view?
- Is it possible to create a generic @helper method with Razor?
- Unobtrusive validation not working on dynamically-added partial view
- Razor actionlink autogenerating ?length=7 in URL?
- Html helper for
- DataAnnotations validation (Regular Expression) in asp.net mvc 4 – razor view
- error with decimal in mvc3 – the value is not valid for field
- MVC Datatype Currency trigger numeric keypad
- Validation does not work when I use Validator.TryValidateObject
- How to persist data models passed to partial views?
- What is the best ways to bind @Html.DropDownListFor in ASP.NET MVC5?
- Adding a css class to select using @Html.DropDownList()
- MVC 3 file upload and model binding
- Does Razor syntax provide a compelling advantage in UI markup?
- Why doesn’t Visual Studio code formatting work properly for Razor markup?
- How to create a function in a cshtml template?
- Razor ViewEngine HTML.Checkbox method creates a hidden input. Why? [duplicate]
- How do I create a MVC Razor template for DisplayFor()