in MVC when we need a form like below that create a new item of my model, we add a strongly type view on the model with create scaffold template, model:
public class book
{
[Key]
public int BId { get; set; }
[Display(Name = "نام")]
public string name { get; set; }
[Display(Name = "نویسنده")]
public string writer { get; set; }
[Display(Name = "ناشر")]
public string publisher { get; set; }
[Display(Name = "سال انتشار")]
public string year { get; set; }
} `
the result is something like this:
@model مدرسه.Models.book
`@{
ViewBag.Title = "BookStore";
} `
` <h2>BookStore</h2>`
@using (Html.BeginForm()) {
@Html.AntiForgeryToken()
@Html.ValidationSummary(true)
<fieldset>
<legend>book</legend>
<div class="editor-label">
@Html.LabelFor(model => model.name)
</div>
<div class="editor-field">
@Html.EditorFor(model => model.name)
@Html.ValidationMessageFor(model => model.name)
</div>
<div class="editor-label">
@Html.LabelFor(model => model.writer)
</div>
<div class="editor-field">
@Html.EditorFor(model => model.writer)
@Html.ValidationMessageFor(model => model.writer)
</div>
<div class="editor-label">
@Html.LabelFor(model => model.publisher)
</div>
<div class="editor-field">
@Html.EditorFor(model => model.publisher)
@Html.ValidationMessageFor(model => model.publisher)
</div>
<div class="editor-label">
@Html.LabelFor(model => model.year)
</div>
<div class="editor-field">
@Html.EditorFor(model => model.year)
@Html.ValidationMessageFor(model => model.year)
</div>
<p>
<input type="submit" value="Create" />
</p>
</fieldset>
`}`
<div>
@Html.ActionLink("Back to List", "Index")
</div>
`@section Scripts {
@Scripts.Render("~/bundles/jqueryval")
} `
this template follow this path:
C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\Extensions\Microsoft\Web\Mvc\Scaffolding
what i need is a knowledge to how change this file and in fact what is this file and what part change the template ?