Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @model Dota2MK_FinalPage.ViewModel.PlayerFormViewModel
- @{
- ViewBag.Title = "Add new player";
- }
- <div class="container-fluid">
- <div class="col-md-6">
- <h2>
- @if (Model.Player.Id == 0)
- {
- <text>New Player</text>
- }
- else
- {
- <text>Edit Player</text>
- }
- </h2>
- </div>
- <div class="col-md-6">
- @Html.ActionLink("Back", "Index", "Player", null, new { @class = "btn btn-primary" })
- </div>
- </div>
- @using (Html.BeginForm("Save", "Player"))
- {
- @Html.ValidationSummary(true, "Please fix the following errors:")
- <div class="form-group">
- @Html.LabelFor(m => m.Player.Nickname)
- @Html.TextBoxFor(m => m.Player.Nickname, new { @class = "form-control" })
- @Html.ValidationMessageFor(m => m.Player.Nickname)
- </div>
- <div class="form-group">
- @Html.LabelFor(m => m.Player.FirstName)
- @Html.TextBoxFor(m => m.Player.FirstName, new { @class = "form-control" })
- @Html.ValidationMessageFor(m => m.Player.FirstName)
- </div>
- <div class="form-group">
- @Html.LabelFor(m => m.Player.LastName)
- @Html.TextBoxFor(m => m.Player.LastName, new { @class = "form-control" })
- @Html.ValidationMessageFor(m => m.Player.LastName)
- </div>
- <div class="form-group">
- @Html.LabelFor(m => m.Player.CountryId)
- @Html.TextBoxFor(m => m.Player.CountryId, new { @class = "form-control" })
- @Html.ValidationMessageFor(m => m.Player.CountryId)
- </div>
- <div class="form-group">
- @Html.LabelFor(m => m.Player.TeamId)
- @Html.DropDownListFor(m => m.Player.TeamId,
- new SelectList(Model.Team, "Id", "Name"), ""
- , new { @class = "form-control" })
- @Html.ValidationMessageFor(m => m.Player.TeamId)
- </div>
- <div class="form-group">
- @Html.LabelFor(m => m.Player.DateOfBirth)
- @Html.TextBoxFor(m => m.Player.DateOfBirth, "{0:d MMM yyyy}", new { @class = "form-control" })
- @Html.ValidationMessageFor(m => m.Player.DateOfBirth)
- </div>
- @Html.HiddenFor(m => m.Player.Id)
- @Html.AntiForgeryToken();
- <input type="submit" class="btn btn-primary" value="Save" />
- }
- @section scripts
- {
- @Scripts.Render("~/bundles/jqueryval")
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement