MVC has conditional attributes built in...
class="@myClass" } }>Content
Content
If @myClass is null, it just won't use the attribute at all...
I know that may not quite solve your current issue, but it is noteworthy!
http://weblogs.asp.net/jgalloway/archive/2012/02/16/asp-net-4-beta-released.aspx