I have one doubt: can we pass Model.item.value to a CSS class in MVC3?
For example:
@foreach (var items in Model)
{
@Html.TextBox(@items.ShortDesc, @items.SfldDefault, new { @class = "@items.ShortDesc"})
}
I want to print my @items.ShortDesc as the CSS class but it’s taking it as a string here.. Any idea?
You just have to write it without the quotation marks and
@symbol (no need for those, as you’re already inside a code block):