Prefer `IHtmlHelper` methods elsewhere in our code

- #847 line 7 sub-bullets
- don't call extension methods from our templates
 - partially addressed in PR #934 (for methods changed there)
- don't reference extension methods from XML comments
This commit is contained in:
dougbu 2014-08-05 11:59:55 -07:00
parent 4c5aa15f0b
commit f4d53a0045
2 changed files with 9 additions and 5 deletions

View File

@ -227,7 +227,11 @@ namespace Microsoft.AspNet.Mvc.Rendering
// TODO: add ModelMetadata.HideSurroundingHtml and use here (skip this block) // TODO: add ModelMetadata.HideSurroundingHtml and use here (skip this block)
{ {
var label = html.Label(propertyMetadata.PropertyName).ToString(); var label = html.Label(
propertyMetadata.PropertyName,
labelText: null,
htmlAttributes: null)
.ToString();
if (!string.IsNullOrEmpty(label)) if (!string.IsNullOrEmpty(label))
{ {
divTag.AddCssClass("editor-label"); divTag.AddCssClass("editor-label");

View File

@ -65,14 +65,14 @@ namespace Microsoft.AspNet.Mvc
public bool ClientValidationEnabled { get; set; } public bool ClientValidationEnabled { get; set; }
/// <summary> /// <summary>
/// Element name used to wrap a top-level message generated by /// Element name used to wrap a top-level message generated by <see cref="IHtmlHelper.ValidationSummary"/> and
/// <see cref="HtmlHelperValidationExtensions.ValidationSummary(IHtmlHelper)"/> and other overloads. /// other overloads.
/// </summary> /// </summary>
public string ValidationSummaryMessageElement { get; set; } public string ValidationSummaryMessageElement { get; set; }
/// <summary> /// <summary>
/// Element name used to wrap a top-level message generated by /// Element name used to wrap a top-level message generated by <see cref="IHtmlHelper.ValidationMessage"/> and
/// <see cref="HtmlHelperValidationExtensions.ValidationMessage(IHtmlHelper, string)"/> and other overloads. /// other overloads.
/// </summary> /// </summary>
public string ValidationMessageElement { get; set; } public string ValidationMessageElement { get; set; }