使用MVC 4我使用“data-message”
属性为model
属性创建一个文本框:
@Html.TextBoxFor(o => o.TradeOrder.Symbol,new {data-message="required"})
但是,我收到以下错误:
Invalid anonymous type member declarator. Anonymous type members must
be declared with a member assignment,simple name or member access.
使用 _:
@Html.TextBoxFor(o => o.TradeOrder.Symbol,new {data_message="required"})
TextBoxFor帮助器将知道该怎么做,并在生成标记时替换它。
原文链接:https://www.f2er.com/aspnet/253533.html