Ternary extension method
I would change your method to use generics (so that the return value is meaningful) and not call .ToString() internally. This will enable you to use it in more scenarios.

public static T GetValueTernary&lt;T&gt;(this HtmlHelper html, object a, object b, T valueIfEqual, T valueIfNotEqual)
{
    return object.Equals(a, b) ? valueIfEqual : valueIfNotEqual;
}


Now you can use it like this as well and also it will enable you to use HtmlString-s as values.

&lt;div class="@Html.GetValueTernary(Model.UserVoteTypeId, VoteType.UpVote, "us", "u").ToUpper()"&gt;...&lt;/div&gt;


You could also benefit (depends on your actual usage) from not using object for the compared values - by using a generic the compiler will complain if the types of the two are not compatible (for example, you are comparing string to int):

public static TReturn GetValueTernary&lt;TValue, TReturn&gt;(this HtmlHelper html, TValue a, TValue b, TReturn valueIfEqual, TReturn valueIfNotEqual)
{
    return object.Equals(a, b) ? valueIfEqual : valueIfNotEqual;
}