title: div adding redirect and background image from code behind in asp.net
body: <p>I have a <code>div</code> in an asp.net master page with <code>runat=server</code>.</p>
  
  <p>What I want to do is from codebehind when the user clicks on the <code>div</code> redirect to another page. I've tried the following:</p>
  
  <p>HTML: </p>
  
  <pre><code>&lt;div id="logoHead" runat="server"&gt;&lt;/div&gt;
  </code></pre>
  
  <p>Code behind:</p>
  
  <pre><code>logoHead.Attributes.Add("OnClick", "window.location = MyUrl"); 
  </code></pre>
  
  <p>This doesnt work, how can I do this?</p>