title: Add CSS class to a div in code behind
body: <p>I have a div and I am trying to add a CSS class to it in code but I receive the following error when I try</p>
  
  <pre><code>Property or indexer 'System.Web.UI.HtmlControls.HtmlControl.Style' cannot be assigned to -- it is read only
  </code></pre>
  
  <p>I am using the following code:</p>
  
  <pre><code>protected void BTNEvent_Click(object sender, ImageClickEventArgs e)
  {
      BtnventCss.Style= "hom_but_a";                 
  }
  </code></pre>
  
  <p>Can anyone please help me?</p>