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 @@
HtmlEncode[[Product_2]]
+
HtmlEncode[[SubstituteProducts]]
HtmlEncode[[Product_0]]
diff --git a/test/Microsoft.AspNetCore.Mvc.FunctionalTests/compiler/resources/HtmlGenerationWebSite.HtmlGeneration_Home.Order.html b/test/Microsoft.AspNetCore.Mvc.FunctionalTests/compiler/resources/HtmlGenerationWebSite.HtmlGeneration_Home.Order.html
index eb6bbd1870..2d40eeca1f 100644
--- a/test/Microsoft.AspNetCore.Mvc.FunctionalTests/compiler/resources/HtmlGenerationWebSite.HtmlGeneration_Home.Order.html
+++ b/test/Microsoft.AspNetCore.Mvc.FunctionalTests/compiler/resources/HtmlGenerationWebSite.HtmlGeneration_Home.Order.html
@@ -20,6 +20,38 @@
Product_2
+
SubstituteProducts
Product_0
diff --git a/test/Microsoft.AspNetCore.Mvc.FunctionalTests/compiler/resources/HtmlGenerationWebSite.HtmlGeneration_Home.OrderUsingHtmlHelpers.Encoded.html b/test/Microsoft.AspNetCore.Mvc.FunctionalTests/compiler/resources/HtmlGenerationWebSite.HtmlGeneration_Home.OrderUsingHtmlHelpers.Encoded.html
index 7f098f9058..7eb0b60878 100644
--- a/test/Microsoft.AspNetCore.Mvc.FunctionalTests/compiler/resources/HtmlGenerationWebSite.HtmlGeneration_Home.OrderUsingHtmlHelpers.Encoded.html
+++ b/test/Microsoft.AspNetCore.Mvc.FunctionalTests/compiler/resources/HtmlGenerationWebSite.HtmlGeneration_Home.OrderUsingHtmlHelpers.Encoded.html
@@ -20,6 +20,38 @@
HtmlEncode[[Product_2]]
+
HtmlEncode[[SubstituteProducts]]
HtmlEncode[[Product_0]]
diff --git a/test/Microsoft.AspNetCore.Mvc.FunctionalTests/compiler/resources/HtmlGenerationWebSite.HtmlGeneration_Home.OrderUsingHtmlHelpers.html b/test/Microsoft.AspNetCore.Mvc.FunctionalTests/compiler/resources/HtmlGenerationWebSite.HtmlGeneration_Home.OrderUsingHtmlHelpers.html
index b301539338..ca7a233d43 100644
--- a/test/Microsoft.AspNetCore.Mvc.FunctionalTests/compiler/resources/HtmlGenerationWebSite.HtmlGeneration_Home.OrderUsingHtmlHelpers.html
+++ b/test/Microsoft.AspNetCore.Mvc.FunctionalTests/compiler/resources/HtmlGenerationWebSite.HtmlGeneration_Home.OrderUsingHtmlHelpers.html
@@ -20,6 +20,38 @@
Product_2
+
SubstituteProducts
Product_0
diff --git a/test/WebSites/HtmlGenerationWebSite/Controllers/HtmlGeneration_HomeController.cs b/test/WebSites/HtmlGenerationWebSite/Controllers/HtmlGeneration_HomeController.cs
index e56daf2ea6..3736f9554c 100644
--- a/test/WebSites/HtmlGenerationWebSite/Controllers/HtmlGeneration_HomeController.cs
+++ b/test/WebSites/HtmlGenerationWebSite/Controllers/HtmlGeneration_HomeController.cs
@@ -52,6 +52,10 @@ namespace HtmlGenerationWebSite.Controllers
{
_productsList = new SelectList(_products, "Number", "ProductName");
_productsListWithSelection = new SelectList(_products, "Number", "ProductName", 2);
+ foreach (var i in _order.Products)
+ {
+ _order.ProductDetails.Add(_products[i]);
+ }
}
public IActionResult Enum()
diff --git a/test/WebSites/HtmlGenerationWebSite/Models/Order.cs b/test/WebSites/HtmlGenerationWebSite/Models/Order.cs
index 9f41a9ae79..7110fde81a 100644
--- a/test/WebSites/HtmlGenerationWebSite/Models/Order.cs
+++ b/test/WebSites/HtmlGenerationWebSite/Models/Order.cs
@@ -55,5 +55,7 @@ namespace HtmlGenerationWebSite.Models
get;
set;
}
+
+ public IList ProductDetails { get; } = new List();
}
}
\ No newline at end of file
diff --git a/test/WebSites/HtmlGenerationWebSite/Views/HtmlGeneration_Home/Order.cshtml b/test/WebSites/HtmlGenerationWebSite/Views/HtmlGeneration_Home/Order.cshtml
index b460aa44d3..e69f3e8ec5 100644
--- a/test/WebSites/HtmlGenerationWebSite/Views/HtmlGeneration_Home/Order.cshtml
+++ b/test/WebSites/HtmlGenerationWebSite/Views/HtmlGeneration_Home/Order.cshtml
@@ -1,4 +1,4 @@
-@model HtmlGenerationWebSite.Models.Order
+@model HtmlGenerationWebSite.Models.Order
@{
ViewBag.Title = "Order Page";
@@ -33,6 +33,34 @@
@{ var @object = "multiple"; }
+
+ @if (Model.ProductDetails.Count > 0)
+ {
+
+ }
+
@* 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)
+ {
+
+
+
+ @Html.LabelFor(m => m.ProductDetails.FirstOrDefault().Number)
+
+
+ @Html.LabelFor(m => m.ProductDetails.FirstOrDefault().ProductName)
+
+
+ @for (var i = 0; i < Model.ProductDetails.Count; i++)
+ {
+
+
+ @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. *@