Advertisement
Guest User

Editview

a guest
Feb 7th, 2016
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 2.45 KB | None | 0 0
  1. @model MyRestaurants.Models.RestaurantReview
  2.  
  3. @{
  4.     ViewBag.Title = "Edit";
  5.     Layout = "~/Views/Shared/_Layout.cshtml";
  6. }
  7.  
  8. <h2>Edit</h2>
  9.  
  10.  
  11. @using (Html.BeginForm())
  12. {
  13.     @Html.AntiForgeryToken()
  14.    
  15.     <div class="form-horizontal">
  16.         <h4>RestaurantReview</h4>
  17.         <hr />
  18.         @Html.ValidationSummary(true, "", new { @class = "text-danger" })
  19.         @Html.HiddenFor(model => model.Id)
  20.  
  21.         <div class="form-group">
  22.             @Html.LabelFor(model => model.Name, htmlAttributes: new { @class = "control-label col-md-2" })
  23.             <div class="col-md-10">
  24.                 @Html.EditorFor(model => model.Name, new { htmlAttributes = new { @class = "form-control" } })
  25.                 @Html.ValidationMessageFor(model => model.Name, "", new { @class = "text-danger" })
  26.             </div>
  27.         </div>
  28.  
  29.         <div class="form-group">
  30.             @Html.LabelFor(model => model.City, htmlAttributes: new { @class = "control-label col-md-2" })
  31.             <div class="col-md-10">
  32.                 @Html.EditorFor(model => model.City, new { htmlAttributes = new { @class = "form-control" } })
  33.                 @Html.ValidationMessageFor(model => model.City, "", new { @class = "text-danger" })
  34.             </div>
  35.         </div>
  36.  
  37.         <div class="form-group">
  38.             @Html.LabelFor(model => model.Country, htmlAttributes: new { @class = "control-label col-md-2" })
  39.             <div class="col-md-10">
  40.                 @Html.EditorFor(model => model.Country, new { htmlAttributes = new { @class = "form-control" } })
  41.                 @Html.ValidationMessageFor(model => model.Country, "", new { @class = "text-danger" })
  42.             </div>
  43.         </div>
  44.  
  45.         <div class="form-group">
  46.             @Html.LabelFor(model => model.Rating, htmlAttributes: new { @class = "control-label col-md-2" })
  47.             <div class="col-md-10">
  48.                 @Html.EditorFor(model => model.Rating, new { htmlAttributes = new { @class = "form-control" } })
  49.                 @Html.ValidationMessageFor(model => model.Rating, "", new { @class = "text-danger" })
  50.             </div>
  51.         </div>
  52.  
  53.         <div class="form-group">
  54.             <div class="col-md-offset-2 col-md-10">
  55.                 <input type="submit" value="Save" class="btn btn-default" />
  56.             </div>
  57.         </div>
  58.     </div>
  59. }
  60.  
  61. <div>
  62.     @Html.ActionLink("Back to List", "Index")
  63. </div>
  64.  
  65. @section Scripts {
  66.     @Scripts.Render("~/bundles/jqueryval")
  67. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement