Created
November 1, 2011 20:27
-
-
Save seif/1331800 to your computer and use it in GitHub Desktop.
S#harp Architecture wiki Simple CRUD Application Sample views
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@model IEnumerable<IceCreamYouScreamCorp.Domain.Product> | |
@{ | |
ViewBag.Title = "Index"; | |
} | |
<h2>Index</h2> | |
<p> | |
@Html.ActionLink("Create New", "Create") | |
</p> | |
<table> | |
<tr> | |
<th> | |
Name | |
</th> | |
<th></th> | |
</tr> | |
@foreach (var item in Model) { | |
<tr> | |
<td> | |
@Html.DisplayFor(modelItem => item.Name) | |
</td> | |
<td> | |
@Html.ActionLink("Edit", "Update", new { id=item.Id }) | |
</td> | |
</tr> | |
} | |
</table> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@model IceCreamYouScreamCorp.Domain.Product | |
@{ | |
ViewBag.Title = "Update"; | |
} | |
<h2>Update</h2> | |
<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script> | |
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script> | |
@using (Html.BeginForm()) { | |
@Html.ValidationSummary(true) | |
<fieldset> | |
<legend>Product</legend> | |
<div class="editor-label"> | |
@Html.LabelFor(model => model.Name) | |
</div> | |
<div class="editor-field"> | |
@Html.EditorFor(model => model.Name) | |
@Html.ValidationMessageFor(model => model.Name) | |
</div> | |
@Html.HiddenFor(model => model.Id) | |
<p> | |
<input type="submit" value="Save" /> | |
</p> | |
</fieldset> | |
@Html.AntiForgeryToken() | |
} | |
<div> | |
@Html.ActionLink("Back to List", "Index") | |
</div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment