I written a custom HtmlHelper
as the following:
public static MvcHtmlString MdActionLink(this HtmlHelper htmlHelper, string resourceId, string actionName, string controllerName, object routeValues = null, object htmlAttributes = null)
{
if (routeValues == null && htmlAttributes != null)
return htmlHelper.ActionLink(ResourcesHelper.GetMessageFromResource(resourceId), actionName, controllerName, htmlAttributes);
return htmlHelper.ActionLink(ResourcesHelper.GetMessageFromResource(resourceId),
actionName, controllerName,
routeValues,
htmlAttributes);
}
It's OK if routeValues
and htmlAttributes
both were null.
But if htmlAttributes
has a value and routeValues
was null, it render a
tag as the follows:
<a comparer="System.Collections.Generic.GenericEqualityComparer`1[System.String]" count="1" keys="System.Collections.Generic.Dictionary`2+KeyCollection[System.String,System.Object]" values="System.Collections.Generic.Dictionary`2+ValueCollection[System.String,System.Object]" href="/Home/Login?Length=7">Exit</a>
What's wrong with it?