title: Is accessing HTML tags in behind code in a static method possible?
body: <p>I can't find a simple answer to this anywhere on the web.</p>
  
  <p>What i'm trying to do is running c# code when ever i click a certain HTML button   with </p>
  
  <pre><code>onclick="&lt;%MethodName()%&gt;"
  </code></pre>
  
  <p>that will collect data from a database and present it on html tags.</p>
  
  <p>Static methods are the only kind i currently know how to use, and never had to deal with one that needs to use SQL as well.
  Problem is, i can't use most of the commands i need to use in a standard static method, nor will it recognize html tags and System.Data variables.</p>
  
  <p>I could however run the code on Page_Load but i don't understand why would i do that if there's a possibility i'm never gonna need to use that information.</p>
  
  <p>If anyone could supply me with an answer on how to use these type of commands in static methods (or show me a better way) that would be spectacular! Thanks in advance!</p>