Näidisrakendus on veebisait kujuteldava Contoso ülikooli jaoks. See hõlmab funktsioone nagu üliõpilaste vastuvõtt, kursuste loomine ja õppejõudude määramine.
Create code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 | @model ContosoUniversity.Models.Course @{ ViewData[ "Title" ] = "Create" ; } <h1>Create</h1> <h4>Course</h4> <hr /> <div class = "row" > <div class = "col-md-4" > <form asp-action= "Create" > <div asp-validation-summary= "ModelOnly" class = "text-danger" ></div> <div class = "form-group" > <label asp- for = "CourseID" class = "control-label" ></label> <input asp- for = "CourseID" class = "form-control" /> <span asp-validation- for = "CourseID" class = "text-danger" ></span> </div> <div class = "form-group" > <label asp- for = "Title" class = "control-label" ></label> <input asp- for = "Title" class = "form-control" /> <span asp-validation- for = "Title" class = "text-danger" ></span> </div> <div class = "form-group" > <label asp- for = "Credits" class = "control-label" ></label> <input asp- for = "Credits" class = "form-control" /> <span asp-validation- for = "Credits" class = "text-danger" ></span> </div> <div class = "form-group" > <label asp- for = "DepartmentID" class = "control-label" ></label> < select asp- for = "DepartmentID" class = "form-control" asp-items= "ViewBag.DepartmentID" > <option value= "" >Select Department</option> </ select > <span asp-validation- for = "DepartmentID" class = "text-danger" ></span> </div> <div class = "form-group" > <input type= "submit" value= "Create" class = "btn btn-primary" /> </div> </form> </div> </div> <div> <a asp-action= "Index" >Back to List</a> </div> |