@model CD67.ModeleMVC.Entity.EXEMPLE_VIKINGS @{ ViewBag.Title = "Create"; Layout = "~/Views/Shared/_Layout.cshtml"; } Vikings

Creation

@using (Html.BeginForm()) { @Html.AntiForgeryToken()

Viking


@Html.ValidationSummary(true, "", new { @class = "text-danger" }) @*Contenu généré mais masqué car inutile, la clé est générée automatiquement dans mon exemple par un trigger/sequence*@ @*
@Html.LabelFor(model => model.ID, "ID", htmlAttributes: new { @class = "control-label col-md-2" })
@Html.DropDownList("ID", null, htmlAttributes: new { @class = "form-control" }) @Html.ValidationMessageFor(model => model.ID, "", new { @class = "text-danger" })
*@
@Html.LabelFor(model => model.NOM, htmlAttributes: new { @class = "control-label col-md-2" })
@Html.EditorFor(model => model.NOM, new { htmlAttributes = new { @class = "form-control autofocus" } }) @Html.ValidationMessageFor(model => model.NOM, "", new { @class = "text-danger" })
@*Liste de choix pour le type, rempli gràce au ViewBag dans le contrôleur*@ @*Liste principale pour la liste imbriquée sous-type*@
@Html.LabelFor(model => model.ID_TYPE, htmlAttributes: new { @class = "control-label col-md-2" })
@Html.DropDownList("ID_TYPE", null, htmlAttributes: new { @class = "form-control liste-principale", @data = "/VIKINGS/listeSousType" }) @Html.ValidationMessageFor(model => model.ID_TYPE, "", new { @class = "text-danger" })
@*Liste de choix d'un sous-type fictif*@
@Html.LabelFor(model => model.ID_SOUS_TYPE, "Sous type", htmlAttributes: new { @class = "control-label col-md-2" })
@Html.DropDownList("ID_SOUS_TYPE", null, htmlAttributes: new { @class = "form-control liste-secondaire" }) @Html.ValidationMessageFor(model => model.ID_SOUS_TYPE, "", new { @class = "text-danger" }) @Html.DescriptionFor(model => model.ID_SOUS_TYPE)
@Html.LabelFor(model => model.DESCRIPTION, htmlAttributes: new { @class = "control-label col-md-2" })
@Html.EditorFor(model => model.DESCRIPTION, new { htmlAttributes = new { @class = "form-control" } }) @Html.ValidationMessageFor(model => model.DESCRIPTION, "", new { @class = "text-danger" })
@Html.LabelFor(model => model.alwaysYes, htmlAttributes: new { @class = "control-label col-md-2" })
@Html.EditorFor(model => model.alwaysYes, new { htmlAttributes = new { @class = "form-control" } }) @Html.ValidationMessageFor(model => model.alwaysYes, "", new { @class = "text-danger" }) @Html.DescriptionFor(model=>model.alwaysYes)
@Html.LabelFor(model => model.alwaysNo, htmlAttributes: new { @class = "control-label col-md-2" })
@Html.EditorFor(model => model.alwaysNo, new { htmlAttributes = new { @class = "form-control" } }) @Html.ValidationMessageFor(model => model.alwaysNo, "", new { @class = "text-danger" }) @Html.DescriptionFor(model => model.alwaysNo)
@Html.LabelFor(model => model.DATE_INUTILE, htmlAttributes: new { @class = "control-label col-md-2" })
@Html.EditorFor(model => model.DATE_INUTILE, new { htmlAttributes = new { @class = "form-control" } }) @Html.ValidationMessageFor(model => model.DATE_INUTILE, "", new { @class = "text-danger" })
}
@*Message d'alerte au retour sur la page précédente*@ Retour