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

Edited Issue: Custom attributes - underscores in name should be replaced [610]

$
0
0
When passing custom attributes to helpers via anonymous object, the "_" should be replaced with "-" just like in MVC helpers

example:

[Fact]
public void WebGridCustomHtmlAttributeIsSpecified()
{
var grid = new WebGrid(GetContext(), ajaxUpdateContainerId: "grid")
.Bind(new[]
{
new { P1 = 1, P2 = '2', P3 = "3" },
new { P1 = 4, P2 = '5', P3 = "6" }
});
var html = grid.GetHtml(htmlAttributes: new {data_attribute = "value"});
string _html = html.ToHtmlString();
Assert.Contains("data-attribute", _html);
}

Viewing all articles
Browse latest Browse all 7215

Trending Articles



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