From f05f6d5bd298a2afcfcb5139697904cdf1852250 Mon Sep 17 00:00:00 2001 From: Doug Bunting Date: Mon, 2 May 2016 12:53:32 -0700 Subject: [PATCH] Quick fix: Simplify `OrderUsingHtmlHelpers.cshtml` layout - intent was to make HTML helper output close to the tag helper output but source got over-complicated - the output files for `Order.cshtml` and `OrderUsingHtmlHelpers.cshtml` now differ only in attribute order - i.e. HTML helpers output attribute alphabetically while tag helpers output them in order added --- ...ion_Home.OrderUsingHtmlHelpers.Encoded.html | 9 ++++++--- ...lGeneration_Home.OrderUsingHtmlHelpers.html | 9 ++++++--- .../OrderUsingHtmlHelpers.cshtml | 18 +++++++++--------- 3 files changed, 21 insertions(+), 15 deletions(-) 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 5407be02cc..7f098f9058 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 @@ -4,7 +4,8 @@ -
+ +
@@ -74,6 +75,8 @@
- -
+ + + + \ No newline at end of file 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 473605348e..b301539338 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 @@ -4,7 +4,8 @@ -
+ +
@@ -74,6 +75,8 @@
- -
+ + + + \ No newline at end of file diff --git a/test/WebSites/HtmlGenerationWebSite/Views/HtmlGeneration_Home/OrderUsingHtmlHelpers.cshtml b/test/WebSites/HtmlGenerationWebSite/Views/HtmlGeneration_Home/OrderUsingHtmlHelpers.cshtml index 5cde504726..5d747436cd 100644 --- a/test/WebSites/HtmlGenerationWebSite/Views/HtmlGeneration_Home/OrderUsingHtmlHelpers.cshtml +++ b/test/WebSites/HtmlGenerationWebSite/Views/HtmlGeneration_Home/OrderUsingHtmlHelpers.cshtml @@ -11,9 +11,9 @@ - @* Use comments and elements to force whitespace in generated HTML. *@@using ( -Html.BeginForm(actionName: "Submit", controllerName: "HtmlGeneration_Order")) - { + @* Use element to force whitespace in generated HTML. *@ + @using (Html.BeginForm(actionName: "Submit", controllerName: "HtmlGeneration_Order")) + {
@Html.LabelFor(m => m.Shipping, htmlAttributes: new { @class = "order" }) @Html.TextBoxFor(m => m.Shipping, format: "Your shipping method is {0}", htmlAttributes: new { size = "50" }) @@ -74,11 +74,11 @@ Html.BeginForm(actionName: "Submit", controllerName: "HtmlGeneration_Order")) @Html.LabelFor(m => m.Customer.Gender, htmlAttributes: new { @class = "order" }) @Html.EditorFor(model => model.Customer.Gender, templateName: "GenderUsingHtmlHelpers") @Html.ValidationMessageFor(m => m.Customer.Gender) -
- @Html.ValidationSummary(message: null, htmlAttributes: new { @class = "order" }) - @Html.HiddenFor(m => m.Customer.Key) - - @Html.AntiForgeryToken(); - }@**@ + + @Html.ValidationSummary(message: null, htmlAttributes: new { @class = "order" }) + @Html.HiddenFor(m => m.Customer.Key) + +
} + \ No newline at end of file