<<назад Students/Create.vbhtml (Contoso University).
1: @ModelType CU_VB_3.Models.Student
2: @Code
3: ViewData("Title") = "Create"
4: Layout = "~/Views/Shared/_Layout.vbhtml"
5: End Code
6:
7: <h2>Create</h2>
8:
9: @Using (Html.BeginForm())
10: @Html.AntiForgeryToken()
11:
12: @<div class="form-horizontal">
13: <h4>Student</h4>
14: <hr />
15: @Html.ValidationSummary(True, "", New With { .class = "text-danger" })
16: <div class="form-group">
17: @Html.LabelFor(Function(model) model.LastName, htmlAttributes:= New With { .class = "control-label col-md-2" })
18: <div class="col-md-10">
19: @Html.EditorFor(Function(model) model.LastName, New With { .htmlAttributes = New With { .class = "form-control" } })
20: @Html.ValidationMessageFor(Function(model) model.LastName, "", New With { .class = "text-danger" })
21: </div>
22: </div>
23:
24: <div class="form-group">
25: @Html.LabelFor(Function(model) model.FirstMidName, htmlAttributes:= New With { .class = "control-label col-md-2" })
26: <div class="col-md-10">
27: @Html.EditorFor(Function(model) model.FirstMidName, New With { .htmlAttributes = New With { .class = "form-control" } })
28: @Html.ValidationMessageFor(Function(model) model.FirstMidName, "", New With { .class = "text-danger" })
29: </div>
30: </div>
31:
32: <div class="form-group">
33: @Html.LabelFor(Function(model) model.EnrollmentDate, htmlAttributes:= New With { .class = "control-label col-md-2" })
34: <div class="col-md-10">
35: @Html.EditorFor(Function(model) model.EnrollmentDate, New With { .htmlAttributes = New With { .class = "form-control" } })
36: @Html.ValidationMessageFor(Function(model) model.EnrollmentDate, "", New With { .class = "text-danger" })
37: </div>
38: </div>
39:
40: <div class="form-group">
41: <div class="col-md-offset-2 col-md-10">
42: <input type="submit" value="Create" class="btn btn-default" />
43: </div>
44: </div>
45: </div>
46: End Using
47:
48: <div>
49: @Html.ActionLink("Back to List", "Index")
50: </div>
51:
52: @Section Scripts
53: @Scripts.Render("~/bundles/jqueryval")
54: End Section
Comments (
)
Link to this page:
//www.vb-net.com/EF-missing-FAQ/Code/Students-Create.vbhtml.htm
|