diff --git a/src/Microsoft.AspNetCore.Mvc.TagHelpers/FormTagHelper.cs b/src/Microsoft.AspNetCore.Mvc.TagHelpers/FormTagHelper.cs index 029f6d72e1..b034882364 100644 --- a/src/Microsoft.AspNetCore.Mvc.TagHelpers/FormTagHelper.cs +++ b/src/Microsoft.AspNetCore.Mvc.TagHelpers/FormTagHelper.cs @@ -229,7 +229,7 @@ namespace Microsoft.AspNetCore.Mvc.TagHelpers output.PostContent.AppendHtml(tagBuilder.InnerHtml); } - if (string.Equals(Method, FormMethod.Get.ToString(), StringComparison.OrdinalIgnoreCase)) + if (string.Equals(Method, "get", StringComparison.OrdinalIgnoreCase)) { antiforgeryDefault = false; } diff --git a/src/Microsoft.AspNetCore.Mvc.ViewFeatures/ViewFeatures/DefaultHtmlGenerator.cs b/src/Microsoft.AspNetCore.Mvc.ViewFeatures/ViewFeatures/DefaultHtmlGenerator.cs index b3d9ebfee3..a76897ab13 100644 --- a/src/Microsoft.AspNetCore.Mvc.ViewFeatures/ViewFeatures/DefaultHtmlGenerator.cs +++ b/src/Microsoft.AspNetCore.Mvc.ViewFeatures/ViewFeatures/DefaultHtmlGenerator.cs @@ -249,7 +249,7 @@ namespace Microsoft.AspNetCore.Mvc.ViewFeatures { defaultMethod = true; } - else if (string.Equals(method, FormMethod.Post.ToString(), StringComparison.OrdinalIgnoreCase)) + else if (string.Equals(method, "post", StringComparison.OrdinalIgnoreCase)) { defaultMethod = true; } @@ -1104,7 +1104,7 @@ namespace Microsoft.AspNetCore.Mvc.ViewFeatures if (string.IsNullOrEmpty(method)) { // Occurs only when called from a tag helper. - method = FormMethod.Post.ToString().ToLowerInvariant(); + method = "post"; } // For tag helpers, htmlAttributes will be null; replaceExisting value does not matter.