Templated Helper Methods

1、Model

Templated Helper Methods_第1张图片

 

2、HomeController

Templated Helper Methods_第2张图片

3、CreatePerson.cshtml

Templated Helper Methods_第3张图片

禁用了客户端验证

4、Using Templated Helper Methods

Templated Helper Methods_第4张图片

Editor 和 EditorFor 是一样的,唯一的区别是EditorFor有只能提示,可以防止输入错误(?)

 

    The type attribute specifies which kind of input element should be displayed by the browser. The helper methods have
specified the number and datetime types for the PersonId and BirthDate properties and the text type, which
is the default for the other properties. The reason that we only see these types in Opera is because the HTML5 features are still not
widely supported, even in the latest version of Internet Explorer and Chrome.

你可能感兴趣的:(template)