Quantcast
Channel: ASPNETWebStack Issue Tracker Rss Feed
Viewing all articles
Browse latest Browse all 7215

Created Issue: WebGrid.GetHtml should accept a dictionary for htmlAttributes [626]

$
0
0
Most MVC Html helpers allow the caller to specify htmlAttributes as either an anonymous object or an IDictionary<string, object>. This is convenient as it makes it possible to easily merge attributes from different sources.

WebGrid.GetHtml (and WebGrid.Table) only accept an anonymous object.

These methods should be enhanced either by adding appropriate overloads, or by checking for a dictionary, e.g.:

... Table(... object htmlAttributes = null)
{
IDictionary<string, object> dictionary = htmlAttributes as IDictionary<string, object>;
if (dictionary == null && htmlAttributes != null)
{
dictionary = HtmlHelper.AnonymousObjectToHtmlAttributes(htmlAttributes);
}
... etc ...
}

Viewing all articles
Browse latest Browse all 7215

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>