Created
August 25, 2016 19:30
-
-
Save jholland918/c777d39e85c7d13feb74b3d25dc44d62 to your computer and use it in GitHub Desktop.
MvcStuff
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 eBowlingFramework.Models.Foo | |
@{ | |
ViewBag.Title = "Create"; | |
} | |
<h2>Create</h2> | |
@using (Html.BeginForm()) | |
{ | |
@Html.AntiForgeryToken() | |
<div class="form-horizontal"> | |
<h4>Foo</h4> | |
<hr /> | |
@Html.ValidationSummary(true, "", new { @class = "text-danger" }) | |
<div class="form-group"> | |
@Html.LabelFor(model => model.Bar, htmlAttributes: new { @class = "control-label col-md-2" }) | |
<div class="col-md-10"> | |
@Html.EditorFor(model => model.Bar, new { htmlAttributes = new { @class = "form-control" } }) | |
@Html.ValidationMessageFor(model => model.Bar, "", new { @class = "text-danger" }) | |
</div> | |
</div> | |
@for (int i = 0; i < Model.Grunts.Count(); i++) | |
{ | |
<div class="editor-label"> | |
@Html.Label("Grunts[" + i + "].Yelp", Model.Grunts[i].Yelp) | |
</div> | |
<div class="editor-field"> | |
@Html.Editor("Grunts[" + i + "].Yelp") | |
</div> | |
} | |
<div class="form-group"> | |
<div class="col-md-offset-2 col-md-10"> | |
<input type="submit" value="Create" class="btn btn-default" /> | |
</div> | |
</div> | |
</div> | |
} | |
<div> | |
@Html.ActionLink("Back to List", "Index") | |
</div> | |
@section Scripts { | |
@Scripts.Render("~/bundles/jqueryval") | |
} |
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
namespace eBowlingFramework.Models | |
{ | |
public class Foo | |
{ | |
public string Bar { get; set; } | |
public List<Grunt> Grunts { get; set; } | |
} | |
} | |
namespace eBowlingFramework.Models | |
{ | |
public class Grunt | |
{ | |
public string Yelp { get; set; } | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment