Advertisement
Guest User

Untitled

a guest
Oct 4th, 2017
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
ASP 2.34 KB | None | 0 0
  1. @model Dota2MK_FinalPage.ViewModel.PlayerFormViewModel
  2.  
  3.  
  4. @{
  5.     ViewBag.Title = "Add new player";
  6. }
  7.  
  8. <div class="container-fluid">
  9.     <div class="col-md-6">
  10.         <h2>
  11.             @if (Model.Player.Id == 0)
  12.             {
  13.                 <text>New Player</text>
  14.             }
  15.             else
  16.             {
  17.                 <text>Edit Player</text>
  18.             }
  19.         </h2>
  20.     </div>
  21.     <div class="col-md-6">
  22.         @Html.ActionLink("Back", "Index", "Player", null, new { @class = "btn btn-primary" })
  23.     </div>
  24. </div>
  25.  
  26.  
  27. @using (Html.BeginForm("Save", "Player"))
  28. {
  29.     @Html.ValidationSummary(true, "Please fix the following errors:")
  30.  
  31.     <div class="form-group">
  32.         @Html.LabelFor(m => m.Player.Nickname)
  33.         @Html.TextBoxFor(m => m.Player.Nickname, new { @class = "form-control" })
  34.         @Html.ValidationMessageFor(m => m.Player.Nickname)
  35.     </div>
  36.     <div class="form-group">
  37.         @Html.LabelFor(m => m.Player.FirstName)
  38.         @Html.TextBoxFor(m => m.Player.FirstName, new { @class = "form-control" })
  39.         @Html.ValidationMessageFor(m => m.Player.FirstName)
  40.     </div>
  41.     <div class="form-group">
  42.         @Html.LabelFor(m => m.Player.LastName)
  43.         @Html.TextBoxFor(m => m.Player.LastName, new { @class = "form-control" })
  44.         @Html.ValidationMessageFor(m => m.Player.LastName)
  45.     </div>
  46.  
  47.     <div class="form-group">
  48.         @Html.LabelFor(m => m.Player.CountryId)
  49.         @Html.TextBoxFor(m => m.Player.CountryId, new { @class = "form-control" })
  50.         @Html.ValidationMessageFor(m => m.Player.CountryId)
  51.     </div>
  52.  
  53.     <div class="form-group">
  54.         @Html.LabelFor(m => m.Player.TeamId)
  55.         @Html.DropDownListFor(m => m.Player.TeamId,
  56.          new SelectList(Model.Team, "Id", "Name"), ""
  57.             , new { @class = "form-control" })
  58.         @Html.ValidationMessageFor(m => m.Player.TeamId)
  59.     </div>
  60.  
  61.  
  62.     <div class="form-group">
  63.         @Html.LabelFor(m => m.Player.DateOfBirth)
  64.         @Html.TextBoxFor(m => m.Player.DateOfBirth, "{0:d MMM yyyy}", new { @class = "form-control" })
  65.         @Html.ValidationMessageFor(m => m.Player.DateOfBirth)
  66.     </div>
  67.  
  68.  
  69.     @Html.HiddenFor(m => m.Player.Id)
  70.     @Html.AntiForgeryToken();
  71.  
  72.     <input type="submit" class="btn btn-primary" value="Save" />
  73. }
  74.  
  75. @section scripts
  76. {
  77.     @Scripts.Render("~/bundles/jqueryval")
  78. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement