title: Adding class attribute from code behind
body: <p>I have the following code:</p>
  
  <p><code>div1.Attributes.Add("class", "displayNone");</code></p>
  
  <p>it works on <code>page load</code> but doesn't on an <code>OnClick</code> event.</p>
  
  <p>This is because my html <code>&lt;div id="div1"&gt;&lt;/div&gt;</code> seems to change to:</p>
  
  <p><code>&lt;div id="div1_ucSomeControl_SoemthingElse"&gt;&lt;/div&gt;</code></p>
  
  <p>after the page has been rendered.</p>
  
  <p>How can I get around this?</p>