You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

MVC3HTML5EDITORTEMPLATES

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

MVC3HTML5EDITORTEMPLATES

Adds HTML5 Editor Templates (to use new input types) with HTML.EditorFor functions, and support additional html attributes (such as data-bind for knockout)

0.9.2
nugetNuGet
Version published
Maintainers
1
Created
Source

The MVC3 HTML5 Editor Templates allow you to use the EditorFor() syntax and produce rich HTML5 input fields from the DataType attribute on your models and also support incorporating html attributes in your Razor View Syntax.

This is particularly helpful when using knockout/js with MVC3 templates.

There is one QUIRK, which defies convention slightly, but works beautifully!

When using the @Html.EditorFor syntax in your view, and specifying additional html attributes, be sure to create a new ViewDataDictionary.

For Example: @Html.EditorFor(model => model.Subject, new ViewDataDictionary(new { data_bind = "value:Subject" }))

Do NOT DO THIS: @Html.EditorFor(model => model.Subject, new { data_bind = "value:Subject" })

When decorating your models, use the [DataType(DataType.Number)] or any other enumeration from the DataType enumeration to get clean, HTML5 input tags.

Keywords

HTML5

FAQs

Package last updated on 07 Mar 2012

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts