Geeks With Blogs

Programmers are tools for converting caffeine into code.

dotNed blogger

Bob Goedkoop Programming C# on Microsoft's .NET plaform MVC
Using data-* attributes in ASP.NET MVC
Technorati Tags: .NET,Razor,C#,MVC,HTML Starting from MVC 3 and up this issue has been addressed. From MVC 3 and up underscores in HTML attributes are automatically converted to dashes. Here’s an example: @Html.TextBox( "tbxOne", "", new { @data_id = "someId", @style= "width:120px; text-align:right;" }) This wil result in: <input data-id="someId" name="tbxOne" type="text" value="" /> ......

Posted On Wednesday, July 3, 2013 1:02 PM

Copyright © Bob Goedkoop | Powered by: