title: Add cssstyle in code-behind with Attributes
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/1903513/adding-css-class-through-aspx-code-behind">Adding css class through aspx code behind</a>  </p>
  </blockquote>
  
  
  
  <p>Im trying to assign a css-class to button created in a overridden CreateChildControls-method like this:</p>
  
  <pre><code>HtmlButton btn = new HtmlButton();
  btn.ServerClick += new EventHandler(resultSelected);
  btn.InnerText = "btn text";
  btn.Attributes.CssStyle.Remove("class");
  btn.Attributes.CssStyle.Add("class", "submitbutton");
  this.Controls.Add(btn);
  PlaceHolder1.Controls.Add(btn);
  </code></pre>
  
  <p>But I guess I need to specify my stylesheet-file for it to work...I want to use the same one as in the aspx.</p>