I'm trying to toggle between enabling or disabling an html button from a Razor view based on an if statement. This disables the button regardless of the value of the if statement.
@{
disabled = "";
if (Model.User.PublicId == ViewBag.SiteUser.PublicId)
{
followClass += " you";
followText = "You";
disabled = "disabled";
}
}
<button class="@followClass" disabled="@(disabled)">@(followText)</button>