diff --git a/src/Microsoft.AspNet.Mvc.ViewFeatures/Properties/Resources.Designer.cs b/src/Microsoft.AspNet.Mvc.ViewFeatures/Properties/Resources.Designer.cs
index 7b8b93dd4d..4c26418900 100644
--- a/src/Microsoft.AspNet.Mvc.ViewFeatures/Properties/Resources.Designer.cs
+++ b/src/Microsoft.AspNet.Mvc.ViewFeatures/Properties/Resources.Designer.cs
@@ -762,6 +762,22 @@ namespace Microsoft.AspNet.Mvc.ViewFeatures
return string.Format(CultureInfo.CurrentCulture, GetString("RemoteAttribute_RemoteValidationFailed"), p0);
}
+ ///
+ /// The name of an HTML field cannot be null or empty. Instead use methods {0}.{1} or {2}.{3} with a non-empty {4} argument value.
+ ///
+ internal static string HtmlGenerator_FieldNameCannotBeNullOrEmpty
+ {
+ get { return GetString("HtmlGenerator_FieldNameCannotBeNullOrEmpty"); }
+ }
+
+ ///
+ /// The name of an HTML field cannot be null or empty. Instead use methods {0}.{1} or {2}.{3} with a non-empty {4} argument value.
+ ///
+ internal static string FormatHtmlGenerator_FieldNameCannotBeNullOrEmpty(object p0, object p1, object p2, object p3, object p4)
+ {
+ return string.Format(CultureInfo.CurrentCulture, GetString("HtmlGenerator_FieldNameCannotBeNullOrEmpty"), p0, p1, p2, p3, p4);
+ }
+
private static string GetString(string name, params string[] formatterNames)
{
var value = _resourceManager.GetString(name);
diff --git a/src/Microsoft.AspNet.Mvc.ViewFeatures/Rendering/Html/DefaultHtmlGenerator.cs b/src/Microsoft.AspNet.Mvc.ViewFeatures/Rendering/Html/DefaultHtmlGenerator.cs
index ea816588e8..9573dce101 100644
--- a/src/Microsoft.AspNet.Mvc.ViewFeatures/Rendering/Html/DefaultHtmlGenerator.cs
+++ b/src/Microsoft.AspNet.Mvc.ViewFeatures/Rendering/Html/DefaultHtmlGenerator.cs
@@ -413,8 +413,15 @@ namespace Microsoft.AspNet.Mvc.Rendering
var fullName = GetFullHtmlFieldName(viewContext, expression);
if (string.IsNullOrEmpty(fullName))
{
- throw new ArgumentException(Resources.ArgumentCannotBeNullOrEmpty, nameof(expression));
- }
+ throw new ArgumentException(
+ Resources.FormatHtmlGenerator_FieldNameCannotBeNullOrEmpty(
+ typeof(IHtmlHelper).FullName,
+ nameof(IHtmlHelper.Editor),
+ typeof(IHtmlHelper<>).FullName,
+ nameof(IHtmlHelper