From 6313a9682e0cc0323279535ab833a78d2940ab73 Mon Sep 17 00:00:00 2001 From: Doug Bunting Date: Tue, 11 Nov 2014 19:37:14 -0800 Subject: [PATCH] Address PR comments in product code - XML comment improvements --- .../Rendering/Html/DefaultHtmlGenerator.cs | 4 +- .../Rendering/Html/HtmlHelper.cs | 8 +-- .../Rendering/Html/IHtmlGenerator.cs | 8 +-- .../Rendering/HtmlHelperFormExtensions.cs | 55 +++++++++---------- .../Rendering/IHtmlHelper.cs | 6 +- 5 files changed, 40 insertions(+), 41 deletions(-) diff --git a/src/Microsoft.AspNet.Mvc.Core/Rendering/Html/DefaultHtmlGenerator.cs b/src/Microsoft.AspNet.Mvc.Core/Rendering/Html/DefaultHtmlGenerator.cs index 73ed23a559..7a46c84174 100644 --- a/src/Microsoft.AspNet.Mvc.Core/Rendering/Html/DefaultHtmlGenerator.cs +++ b/src/Microsoft.AspNet.Mvc.Core/Rendering/Html/DefaultHtmlGenerator.cs @@ -185,7 +185,7 @@ namespace Microsoft.AspNet.Mvc.Rendering /// public TagBuilder GenerateRouteForm( - [NotNull]ViewContext viewContext, + [NotNull] ViewContext viewContext, string routeName, object routeValues, string method, @@ -810,7 +810,7 @@ namespace Microsoft.AspNet.Mvc.Rendering if (string.IsNullOrEmpty(method)) { // Occurs only when called from a tag helper. - method = FormMethod.Post.ToString(); + method = FormMethod.Post.ToString().ToLowerInvariant(); } // For tag helpers, htmlAttributes will be null; replaceExisting value does not matter. diff --git a/src/Microsoft.AspNet.Mvc.Core/Rendering/Html/HtmlHelper.cs b/src/Microsoft.AspNet.Mvc.Core/Rendering/Html/HtmlHelper.cs index e133912408..1ba65f20b6 100644 --- a/src/Microsoft.AspNet.Mvc.Core/Rendering/Html/HtmlHelper.cs +++ b/src/Microsoft.AspNet.Mvc.Core/Rendering/Html/HtmlHelper.cs @@ -617,7 +617,7 @@ namespace Microsoft.AspNet.Mvc.Rendering /// /// Renders a <form> start tag to the response. When the user submits the form, the - /// method will process the request. + /// the action with name will process the request. /// /// The name of the action method. /// The name of the controller. @@ -661,8 +661,8 @@ namespace Microsoft.AspNet.Mvc.Rendering } /// - /// Renders a <form> start tag to the response. When the user submits the form, the - /// route will forward the request to an action method. + /// Renders a <form> start tag to the response. The route with name + /// generates the <form>'s action attribute value. /// /// The name of the route. /// @@ -894,7 +894,7 @@ namespace Microsoft.AspNet.Mvc.Rendering protected virtual string GenerateValue(string name, object value, string format, bool useViewData) { var fullName = DefaultHtmlGenerator.GetFullHtmlFieldName(ViewContext, name); - var attemptedValue = + var attemptedValue = (string)DefaultHtmlGenerator.GetModelStateValue(ViewContext, fullName, typeof(string)); string resolvedValue; diff --git a/src/Microsoft.AspNet.Mvc.Core/Rendering/Html/IHtmlGenerator.cs b/src/Microsoft.AspNet.Mvc.Core/Rendering/Html/IHtmlGenerator.cs index 65a4c1ed7a..bbce6d96a0 100644 --- a/src/Microsoft.AspNet.Mvc.Core/Rendering/Html/IHtmlGenerator.cs +++ b/src/Microsoft.AspNet.Mvc.Core/Rendering/Html/IHtmlGenerator.cs @@ -49,8 +49,8 @@ namespace Microsoft.AspNet.Mvc.Rendering string name); /// - /// Generate a <form> element. When the user submits the form, the method - /// will process the request. + /// Generate a <form> element. When the user submits the form, the action with name + /// will process the request. /// /// A instance for the current scope. /// The name of the action method. @@ -78,8 +78,8 @@ namespace Microsoft.AspNet.Mvc.Rendering object htmlAttributes); /// - /// Generate a <form> element. When the user submits the form, the route - /// will forward the request to an action method. + /// Generate a <form> element. The route with name generates the + /// <form>'s action attribute value. /// /// A instance for the current scope. /// The name of the route. diff --git a/src/Microsoft.AspNet.Mvc.Core/Rendering/HtmlHelperFormExtensions.cs b/src/Microsoft.AspNet.Mvc.Core/Rendering/HtmlHelperFormExtensions.cs index 76508bbd7f..6809f24c62 100644 --- a/src/Microsoft.AspNet.Mvc.Core/Rendering/HtmlHelperFormExtensions.cs +++ b/src/Microsoft.AspNet.Mvc.Core/Rendering/HtmlHelperFormExtensions.cs @@ -9,9 +9,8 @@ namespace Microsoft.AspNet.Mvc.Rendering public static class HtmlHelperFormExtensions { /// - /// Renders a <form> start tag to the response. When the user submits the form, - /// the request will be processed by same action. That is the rendered URL will match the current - /// request. + /// Renders a <form> start tag to the response. The <form>'s action attribute value will + /// match the current request. /// /// The instance this method extends. /// @@ -29,7 +28,7 @@ namespace Microsoft.AspNet.Mvc.Rendering /// /// Renders a <form> start tag to the response. When the user submits the form, the - /// current action method will process the request. + /// current action will process the request. /// /// The instance this method extends. /// The HTTP method for processing the form, either GET or POST. @@ -47,7 +46,7 @@ namespace Microsoft.AspNet.Mvc.Rendering /// /// Renders a <form> start tag to the response. When the user submits the form, the - /// current action method will process the request. + /// current action will process the request. /// /// The instance this method extends. /// The HTTP method for processing the form, either GET or POST. @@ -73,7 +72,7 @@ namespace Microsoft.AspNet.Mvc.Rendering /// /// Renders a <form> start tag to the response. When the user submits the form, the - /// current action method will process the request. + /// current action will process the request. /// /// The instance this method extends. /// @@ -96,8 +95,8 @@ namespace Microsoft.AspNet.Mvc.Rendering } /// - /// Renders a <form> start tag to the response. When the user submits the form, the - /// method will process the request. + /// Renders a <form> start tag to the response. When the user submits the form, the action with name + /// will process the request. /// /// The instance this method extends. /// The name of the action method. @@ -118,8 +117,8 @@ namespace Microsoft.AspNet.Mvc.Rendering } /// - /// Renders a <form> start tag to the response. When the user submits the form, the - /// method will process the request. + /// Renders a <form> start tag to the response. When the user submits the form, the action with name + /// will process the request. /// /// The instance this method extends. /// The name of the action method. @@ -148,8 +147,8 @@ namespace Microsoft.AspNet.Mvc.Rendering } /// - /// Renders a <form> start tag to the response. When the user submits the form, the - /// method will process the request. + /// Renders a <form> start tag to the response. When the user submits the form, the action with name + /// will process the request. /// /// The instance this method extends. /// The name of the action method. @@ -172,8 +171,8 @@ namespace Microsoft.AspNet.Mvc.Rendering } /// - /// Renders a <form> start tag to the response. When the user submits the form, the - /// method will process the request. + /// Renders a <form> start tag to the response. When the user submits the form, the action with name + /// will process the request. /// /// The instance this method extends. /// The name of the action method. @@ -204,8 +203,8 @@ namespace Microsoft.AspNet.Mvc.Rendering } /// - /// Renders a <form> start tag to the response. When the user submits the form, the - /// method will process the request. + /// Renders a <form> start tag to the response. When the user submits the form, the action with name + /// will process the request. /// /// The instance this method extends. /// The name of the action method. @@ -234,8 +233,8 @@ namespace Microsoft.AspNet.Mvc.Rendering } /// - /// Renders a <form> start tag to the response. When the user submits the form, the - /// default route will forward the request to an action method. + /// Renders a <form> start tag to the response. The first route that can provide a URL with the + /// specified generates the <form>'s action attribute value. /// /// The instance this method extends. /// @@ -261,8 +260,8 @@ namespace Microsoft.AspNet.Mvc.Rendering } /// - /// Renders a <form> start tag to the response. When the user submits the form, the - /// route will forward the request to an action method. + /// Renders a <form> start tag to the response. The route with name + /// generates the <form>'s action attribute value. /// /// The instance this method extends. /// The name of the route. @@ -282,8 +281,8 @@ namespace Microsoft.AspNet.Mvc.Rendering } /// - /// Renders a <form> start tag to the response. When the user submits the form, the - /// route will forward the request to an action method. + /// Renders a <form> start tag to the response. The route with name + /// generates the <form>'s action attribute value. /// /// The instance this method extends. /// The name of the route. @@ -309,8 +308,8 @@ namespace Microsoft.AspNet.Mvc.Rendering } /// - /// Renders a <form> start tag to the response. When the user submits the form, the - /// route will forward the request to an action method. + /// Renders a <form> start tag to the response. The route with name + /// generates the <form>'s action attribute value. /// /// The instance this method extends. /// The name of the route. @@ -330,8 +329,8 @@ namespace Microsoft.AspNet.Mvc.Rendering } /// - /// Renders a <form> start tag to the response. When the user submits the form, the - /// route will forward the request to an action method. + /// Renders a <form> start tag to the response. The route with name + /// generates the <form>'s action attribute value. /// /// The instance this method extends. /// The name of the route. @@ -359,8 +358,8 @@ namespace Microsoft.AspNet.Mvc.Rendering } /// - /// Renders a <form> start tag to the response. When the user submits the form, the - /// route will forward the request to an action method. + /// Renders a <form> start tag to the response. The route with name + /// generates the <form>'s action attribute value. /// /// The instance this method extends. /// The name of the route. diff --git a/src/Microsoft.AspNet.Mvc.Core/Rendering/IHtmlHelper.cs b/src/Microsoft.AspNet.Mvc.Core/Rendering/IHtmlHelper.cs index 73ce13e961..0b2fa033a0 100644 --- a/src/Microsoft.AspNet.Mvc.Core/Rendering/IHtmlHelper.cs +++ b/src/Microsoft.AspNet.Mvc.Core/Rendering/IHtmlHelper.cs @@ -83,7 +83,7 @@ namespace Microsoft.AspNet.Mvc.Rendering /// /// Renders a <form> start tag to the response. When the user submits the form, the - /// method will process the request. + /// the action with name will process the request. /// /// The name of the action method. /// The name of the controller. @@ -112,8 +112,8 @@ namespace Microsoft.AspNet.Mvc.Rendering object htmlAttributes); /// - /// Renders a <form> start tag to the response. When the user submits the form, the - /// route will forward the request to an action method. + /// Renders a <form> start tag to the response. The route with name + /// generates the <form>'s action attribute value. /// /// The name of the route. ///