Working snippet
<div class="item @("0" == "0" ? "disabled" : "")" @Html.Raw("0" == "0" ? "style='cursor: default;'" : "")>
Adding Html.Raw() fixed the problem for me. Without this, you will get something like:
<div class="item disabled" style='cursor: default;'>
I tried several different browsers, and each of them gave different results when checking the DOM. IE8 controls it; Chrome incorrectly reinstalls it; IE9 seems to make it well-formed correctly.
A few notes:
- @James's solution, which removes inline styles, is a good one. Current code is really hard to read, and inline styles are rarely a good idea.
- It looks like
item.AvailableTimeSlots should be an integer, not a string.
source share