Generated MVC View: Authors/Edit.cshtml


Clicking on the hyperlink of the view Authors/Index.cshtml, the view Authors/Edit.cshtml will be displayed as follows:



 



 




C:\ASP.NET-workspace\BookStore3\Views\Authors\Edit.cshtml
 @model BookStore3.Models.Author

 @{ ViewData["Title"] = "Edit"; }

 <h1>Edit</h1><h4>Author</h4><hr />
 <div class="row">
   <div class="col-md-4">
     <form asp-action="Edit">
       <div asp-validation-summary="ModelOnly" class="text-danger"></div>
       <input type="hidden" asp-for="Id" />
     
       <div class="form-group">
         <label asp-for="Name" class="control-label"></label>
         <input asp-for="Name" class="form-control" />
         <span asp-validation-for="Name" class="text-danger"></span>
       </div>

       <div class="form-group">
         <label asp-for="BookId" class="control-label"></label>
         <select asp-for="BookId" class="form-control" asp-items="ViewBag.BookId"></select>
         <span asp-validation-for="BookId" class="text-danger"></span>
       </div>

       <div class="form-group">
         <input type="submit" value="Save" class="btn btn-primary" />
       </div>
     </form>
   </div>
 </div>

 <div><a asp-action="Index">Back to List</a></div>

 @section Scripts {
   @{ await Html.RenderPartialAsync( "_ValidationScriptsPartial" ); }
 }




      “I just joined a gym.    
      I don’t work out there,    
      I just joined it.    
      It’s nice to have something to cancel.”    
      — Todd Barry