Advertisement
Guest User

Untitled

a guest
Jan 1st, 2020
193
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.51 KB | None | 0 0
  1. @model Model.Product
  2.  
  3. @{
  4. ViewBag.Title = "Index";
  5. }
  6.  
  7.  
  8.  
  9. <h2>Index</h2>
  10.  
  11. @using (Html.BeginForm("Form","Home",FormMethod.Post, new { enctype = "multipart/form-data" }))
  12. {
  13. @Html.AntiForgeryToken()
  14.  
  15. <div class="form-horizontal">
  16.  
  17. <h4>Product</h4>
  18. <hr />
  19.  
  20. @Html.ValidationSummary(true, "", new { @class = "text-danger" })
  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.Price, htmlAttributes: new { @class = "control-label col-md-2" })
  31. <div class="col-md-10">
  32. @Html.EditorFor(model => model.Price, new { htmlAttributes = new { @class = "form-control" } })
  33. @Html.ValidationMessageFor(model => model.Price, "", new { @class = "text-danger" })
  34. </div>
  35. </div>
  36.  
  37. <div class="form-group">
  38. @Html.LabelFor(model => model.Description, htmlAttributes: new { @class = "control-label col-md-2" })
  39. <div class="col-md-10">
  40. @Html.EditorFor(model => model.Description, new { htmlAttributes = new { @class = "form-control" } })
  41. @Html.ValidationMessageFor(model => model.Description, "", new { @class = "text-danger" })
  42. </div>
  43. </div>
  44.  
  45. <div class="form-group">
  46. @Html.LabelFor(model => model.Category, htmlAttributes: new { @class = "control-label col-md-2" })
  47. <div class="col-md-10">
  48. @Html.EditorFor(model => model.Category, new { htmlAttributes = new { @class = "form-control" } })
  49. @Html.ValidationMessageFor(model => model.Category, "", new { @class = "text-danger" })
  50. </div>
  51. </div>
  52.  
  53. <div class="form-group">
  54. @Html.LabelFor(model => model.Picture, htmlAttributes: new { @class = "control-label col-md-2" })
  55. <div class="col-md-10">
  56. <input type="file" name="file" id="file"/><br><br>
  57. </div>
  58. </div>
  59.  
  60.  
  61. <div class="form-group">
  62. <div class="col-md-offset-2 col-md-10">
  63. <input type="submit" id="Submit" value="Create" class="btn btn-default" />
  64. </div>
  65. </div>
  66.  
  67. </div>
  68. }
  69.  
  70. <div>
  71. @Html.ActionLink("Back to List", "Index")
  72. </div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement