Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

With EditorFor helpers and proper get/post methods

  • Loading branch information...
commit 0cc578be6088c49f1c084443c147434eb9b8b748 1 parent 943f2d3
@mrchief mrchief authored
View
8 Ebuy/Website/Controllers/AuctionsController.cs
@@ -118,6 +118,14 @@ private ActionResult ActiveAuctionsResult(IEnumerable<Auction> auctions)
return View("Auctions", viewModel);
}
+ [HttpGet]
+ [Route("auctions/Create/")]
+ public ActionResult Create()
+ {
+ return View();
+ }
+
+ [HttpPost]
[Route("auctions/Create/{auction}")]
public ActionResult Create(AuctionViewModel auction)
{
View
10 Ebuy/Website/Views/Auctions/Create.cshtml
@@ -13,18 +13,22 @@
<p>
@Html.LabelFor(model => model.Title)
@Html.EditorFor(model => model.Title)
+ @Html.ValidationMessageFor(model => model.Title, "*")
</p>
<p>
@Html.LabelFor(model => model.Description)
@Html.EditorFor(model => model.Description)
+ @Html.ValidationMessageFor(model => model.Description, "*")
</p>
<p>
@Html.LabelFor(model => model.StartPrice)
- @Html.TextBoxFor(model => model.StartPrice)
+ @Html.EditorFor(model => model.StartPrice)
+ @Html.ValidationMessageFor(model => model.StartPrice)
</p>
<p>
@Html.LabelFor(model => model.EndTime)
- @Html.TextBoxFor(model => model.EndTime)
+ @Html.EditorFor(model => model.EndTime)
+ @Html.ValidationMessageFor(model => model.EndTime)
</p>
<p>
<input type="submit" value="Create" />
@@ -36,5 +40,5 @@
</div>
@section Scripts {
- @Scripts.Render("~/bundles/jqueryval")
+ @*@Scripts.Render("~/bundles/jqueryval")*@
}
Please sign in to comment.
Something went wrong with that request. Please try again.