Chl*_*bta 4 asp.net-mvc entity-framework
我想知道如何更改数据实体框架中的显示名称和错误消息.我试过这样但是没用.
[Required(ErrorMessage = "Required .... :")]
[Display(Name = "Name Agency : ")]
[EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
[DataMemberAttribute()]
public global::System.String Nag
{
get
{
//code
}
set
{
//code
}
}
Run Code Online (Sandbox Code Playgroud)
这是我的观点只有表格(我的表格的一部分,因为它全部类似于此)它允许我在我的Db中添加新数据:
<% using (Html.BeginForm("addcar", "Agence", FormMethod.Post, new { @class = "search_form" }))
{ %>
<%: Html.ValidationSummary(true) %>
<div class="editor-label">
<%: Html.LabelFor(model => model.Dmcv) %>
</div>
<div class="editor-field">
<%: Html.EditorFor(model => model.Dmcv) %>
<%: Html.ValidationMessageFor(model => model.Dmcv) %>
</div>
<div class="editor-label">
<%: Html.LabelFor(model => model.Puisv) %>
</div>
<div class="editor-field">
<%: Html.EditorFor(model => model.Puisv) %>
<%: Html.ValidationMessageFor(model => model.Puisv) %>
</div>
// Similaire code
<p>
<input type="submit" value="Create" />
</p>
<% } %>
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
16944 次 |
| 最近记录: |