Create.cshtml 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. @model CD67.ModeleMVC.Entity.TypeViking
  2. @{
  3. ViewBag.Title = "Create";
  4. Layout = "~/Views/Shared/_Layout.cshtml";
  5. }
  6. <title>Type de Vikings</title>
  7. <h2>Creation</h2>
  8. @using (Html.BeginForm())
  9. {
  10. @Html.AntiForgeryToken()
  11. <div class="form-horizontal">
  12. <h4>Type de Viking</h4>
  13. <hr />
  14. @Html.ValidationSummary(true, "", new { @class = "text-danger" })
  15. @*Contenu généré mais masqué car inutile, la clé est générée automatiquement dans mon exemple par un trigger/sequence*@
  16. @*<div class="form-group">
  17. @Html.LabelFor(model => model.ID, htmlAttributes: new { @class = "control-label col-md-2" })
  18. <div class="col-md-10">
  19. @Html.EditorFor(model => model.ID, new { htmlAttributes = new { @class = "form-control" } })
  20. @Html.ValidationMessageFor(model => model.ID, "", new { @class = "text-danger" })
  21. </div>
  22. </div>*@
  23. <div class="form-group">
  24. @Html.LabelFor(model => model.Libelle, htmlAttributes: new { @class = "control-label col-md-2" })
  25. <div class="col-md-10">
  26. @Html.EditorFor(model => model.Libelle, new { htmlAttributes = new { @class = "form-control autofocus" } })
  27. @Html.ValidationMessageFor(model => model.Libelle, "", new { @class = "text-danger" })
  28. </div>
  29. </div>
  30. <div class="col-md-7">
  31. </div>
  32. <div class="form-group col-md-5">
  33. <div class="col-md-offset-2 col-md-10">
  34. <input type="submit" value="Ajouter" class="btn btn-success" />
  35. <input onclick="location.href='@Url.Action("Index", "TypeViking")';return false;" value="Retour" class="btn btn-default" />
  36. </div>
  37. </div>
  38. </div>
  39. }