I am using Bootstrap alert and i'm trying to change the alert class from a static method in the code behind but i'm experiencing an error when trying to do so, which is:
An object reference is required for a non static field.
Im pretty new to this so any help would be much appreciated
aspx.cs:
public static void alert()
{
wallboardAlert.Visible = alertVisable;
wallboardAlert.Attributes["class"] = alertClassType;
}
.aspx
<div class="" id="wallboardAlert" runat="server">
<h1 id="wallboardAlertTitle" runat="server"><strong></strong></h1>
<h4 id="wallboardAlertBody" runat="server"></h4>
</div>