I got it to work with
@Html.EditorFor(model => model.Foo)
and then making a file at Views/Shared/EditorTemplates/Boolean.cshtml with the following:
@model bool?
@Html.CheckBox("", Model.GetValueOrDefault())
More Related Contents:
- Escape @ character in razor view engine
- How can I use a reportviewer control in an asp.net mvc 3 razor view?
- What is the @Html.DisplayFor syntax for?
- Razor HtmlHelper Extensions (or other namespaces for views) Not Found
- Converting DateTime format using razor
- dropdownlist set selected value in MVC3 Razor
- MVC Razor dynamic model, ‘object’ does not contain definition for ‘PropertyName’
- How to add extra namespaces to Razor pages instead of @using declaration?
- Unexpected “foreach” keyword after “@” character
- Loading a partial view in jquery.dialog
- The name ‘model’ does not exist in current context in MVC3
- The name ‘ViewBag’ does not exist in the current context
- Is it possible to display raw Html from database in ASP.NET MVC 3?
- Razor If/Else conditional operator syntax [duplicate]
- MVC 3: Add usercontrol to Razor view
- Razor comment syntax
- Razor doesn’t understand unclosed html tags
- @Html.BeginForm Displaying “System.Web.Mvc.Html.MvcForm” on Page
- Display encoded html with razor
- The view must derive from WebViewPage, or WebViewPage
- Currency Formatting MVC
- Accessing a Session object from Razor _Layout.cshml
- Creating MVC3 Razor Helper like Helper.BeginForm()
- How to specify ID for an Html.LabelFor (MVC Razor) [duplicate]
- Razor reseverd words
- Using MVC HtmlHelper extensions from Razor declarative views
- Default ASP.NET MVC 3 model binder doesn’t bind decimal properties
- How to validate one field related to another’s value in ASP .NET MVC 3
- MVC 3: How to render a view without its layout page when loaded via ajax?
- How to extend MVC3 Label and LabelFor HTML helpers?