开发者

EditorFor dilemma

I understand th开发者_如何学Cat Html.EditorFor is the best practice for creating form fields, but I'm really annoyed that I cannot add html attributes to it.

I understand the reason for that, but I just cannot imagine form fields without css class declarations. Is it really the formal best practice to use EditorFor, or should I use TextBoxFor, or even plain HTML element, for defining additional html attributes?

In addition, since I'm planning to handle all form elements using client-side scripts, I don't really need any special server-side functionality, so I'm having a hard time figuring out what advantages do I get from using EditorFor / TextBoxFor.

What do you think about that?


you can use templated helpers for Html.EditorFor which really is the only reason to use it in the first place.

here's an mvc2 article, but it's the same in mvc3.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜