开发者

Html.TextBoxFor overload which allows formatting

Is there any Html.TextBoxFor overload implementation which allows value formatting?

I know about EditorFor and DataFormatString but it is not what I开发者_运维问答 am looking for.


Why not use an EditorTemplate? Of course, if you're going to use different ways of formatting the same objects you're going to have to use the template name in the call to EditorFor() (so it'll look like EditorFor(object, "TemplateName").

Another option is to add your own HTML Helper. The MVC source code is open so you can download the RTM sources for 2/3 and look at how Html.TextBoxFor() is implemented.

I think EditorFor() is the correct solution to this problem. Why don't you want to use it?


It is possible in ASP.NET MVC 4: http://forums.asp.net/p/1720963/4599128.aspx/1?Html+TextBoxFor+value+formatting

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜