public class BPLModel { public BPLModel() { LLIST = new List<SelectListItem>(); } public int BookId { get; set; } [Remote("IsCodeExist", "BPL", ErrorMessage = "code is not exist")] public string BookCode { get; set; } public string Bookname { get; set; } public string AuthorName { get; set; } public string TranslatorName { get; set; } public string LevelName { get; set; } public IEnumerable<SelectListItem> LLIST { get; set; } }
model BookPublication.Models.BPLModel @{ ViewBag.Title = "create"; } @using (Html.BeginForm()) { @Html.AntiForgeryToken() @Html.ValidationSummary(true) <fieldset> <legend>BPLModel</legend> <!--bookcode, bookname from table book. AuthorName, TranslatorName form table author. LevelName form table bpl --> <div class="editor-label"> @Html.LabelFor(model => model.BookCode) </div> <div class="editor-field"> @Html.EditorFor(model => model.BookCode) @Html.ValidationMessageFor(model => model.BookCode) </div> <div class="editor-label"> @Html.LabelFor(model => model.Bookname) </div> <div class="editor-field"> @Html.EditorFor(model => model.Bookname) @Html.ValidationMessageFor(model => model.Bookname) </div> <div class="editor-label"> @Html.LabelFor(model => model.AuthorName) </div> <div class="editor-field"> @Html.EditorFor(model => model.AuthorName) @Html.ValidationMessageFor(model => model.AuthorName) </div> <div class="editor-label"> @Html.LabelFor(model => model.TranslatorName) </div> <div class="editor-field"> @Html.EditorFor(model => model.TranslatorName) @Html.ValidationMessageFor(model => model.TranslatorName) </div> } <p> <input type="submit" name="submit1" value="fill"> </p> <div class="editor-label"> @Html.LabelFor(model => model.LevelName) </div> <div class="editor-field"> <div class="editor-field"> @Html.DropDownListFor(model => model.LevelId, Model.LLIST) </div> </div> <p> <input type="submit" value="create" /> </p> </fieldset> }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)