diff --git a/test/Microsoft.AspNetCore.Mvc.FunctionalTests/compiler/resources/HtmlGenerationWebSite.HtmlGeneration_Home.Order.Encoded.html b/test/Microsoft.AspNetCore.Mvc.FunctionalTests/compiler/resources/HtmlGenerationWebSite.HtmlGeneration_Home.Order.Encoded.html index 700c9b1e45..97428777dc 100644 --- a/test/Microsoft.AspNetCore.Mvc.FunctionalTests/compiler/resources/HtmlGenerationWebSite.HtmlGeneration_Home.Order.Encoded.html +++ b/test/Microsoft.AspNetCore.Mvc.FunctionalTests/compiler/resources/HtmlGenerationWebSite.HtmlGeneration_Home.Order.Encoded.html @@ -20,6 +20,38 @@ +
+ + + + + + + + + + + + + +
+ + + +
+ + + + + +
+ + + + + +
+
+
+ + + + + + + + + + + + + +
+ + + +
+ + + + + +
+ + + + + +
+
+
+ + + + + + + + + + + + + +
+ + + +
+ + + + + +
+ + + + + +
+
+
+ + + + + + + + + + + + + +
+ + + +
+ + + + + +
+ + + + + +
+
+
+ @if (Model.ProductDetails.Count > 0) + { + + + + + + @for (var i = 0; i < Model.ProductDetails.Count; i++) + { + + + + + } +
+ + + +
+ + + + + +
+ } +
@* Use same select list as Products. Selection when Products is non-null is not used here. *@ diff --git a/test/WebSites/HtmlGenerationWebSite/Views/HtmlGeneration_Home/OrderUsingHtmlHelpers.cshtml b/test/WebSites/HtmlGenerationWebSite/Views/HtmlGeneration_Home/OrderUsingHtmlHelpers.cshtml index 5d747436cd..b1f779ae14 100644 --- a/test/WebSites/HtmlGenerationWebSite/Views/HtmlGeneration_Home/OrderUsingHtmlHelpers.cshtml +++ b/test/WebSites/HtmlGenerationWebSite/Views/HtmlGeneration_Home/OrderUsingHtmlHelpers.cshtml @@ -27,6 +27,34 @@ @{ var productSelectList = (IEnumerable)ViewBag.Items; } @Html.ListBoxFor(m => m.Products, productSelectList)
+
+ @if (Model.ProductDetails.Count > 0) + { + + + + + + @for (var i = 0; i < Model.ProductDetails.Count; i++) + { + + + + + } +
+ @Html.LabelFor(m => m.ProductDetails.FirstOrDefault().Number) + + @Html.LabelFor(m => m.ProductDetails.FirstOrDefault().ProductName) +
+ @Html.TextBoxFor(m => m.ProductDetails[i].Number, htmlAttributes: new { type = "number" }) + @Html.ValidationMessageFor(m => m.ProductDetails[i].Number, message: null, htmlAttributes: new { @class = "text-danger", style = "" }) + + @Html.TextBoxFor(m => m.ProductDetails[i].ProductName) + @Html.ValidationMessageFor(m => m.ProductDetails[i].ProductName, message: null, htmlAttributes: new { @class = "text-danger", style = "" }) +
+ } +
@Html.LabelFor(m => m.SubstituteProducts, htmlAttributes: new { @class = "order" }) @* Use same select list as Products. Selection when Products is non-null is not used here. *@