title: Run server side function on anchor tag click
body: <p>I need to track when a file link is clicked on so I built a server side function that writes to a SQL DB when an anchor tag is clicked. It's not firing or opening the file. Here is my code:</p>
  
  <h2>HTML</h2>
  
  <pre><code>&lt;a href="pdf/Access2013.pdf#zoom=100" runat="server" onServerClick="AccessFile_Click" target="_blank"&gt;&lt;img src="img/pdf_icon.png" border="0" /&gt;&lt;/a&gt;
  </code></pre>
  
  <h2>SERVER CODE</h2>
  
  <pre><code>protected void AccessFile_Click(object sender, EventArgs e)
  {
    App_Code.bi.LogFileDownload("Access File", Session["UserID"].ToString());
  }
  </code></pre>