私はこれを持っています:
[Display(Name = "Empresa")]
public string Company{ get; set; }
私のaspxには次のものがあります:
<th><%: Html.LabelFor(model => model.Company)%></th>
そして、これは以下を生成します:
<th><label for="Company">Empresa</label></th>
ラベルなしで表示属性のみを表示し、プレーンテキストのみを表示する html ヘルパー拡張機能はありますか? 私の望ましい出力はこれです:
<th>Empresa</th>
ありがとう!
編集
提案どおりに DisplayFor または DisplayTextFor を試しましたが、次のように生成されるため有効ではありません。
<th>Amazon</th>
プロパティの値を返します... Display 属性の名前が必要です。