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

Edited 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>. The overload that takes a dictionary is convenient as it makes it possible to easily merge attributes from different sources.<br /><br />WebGrid.GetHtml (and WebGrid.Table) only accept an anonymous object.<br /><br />These methods should be enhanced either by adding appropriate overloads, or by checking for a dictionary, e.g.:<br /><br /> ... Table(... object htmlAttributes = null)<br /> { <br /> IDictionary<string, object> dictionary = htmlAttributes as IDictionary<string, object>;<br /> if (dictionary == null && htmlAttributes != null)<br /> {<br /> dictionary = HtmlHelper.AnonymousObjectToHtmlAttributes(htmlAttributes);<br /> }<br /> ... etc ...<br /> }

Viewing all articles
Browse latest Browse all 7215

Trending Articles



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