title: C# function calling in cshtml
body: <p>I am not able to call a function in my CSHTML code, despite many efforts. Is a construction like this even roughly possible to work?</p>
  
  <pre><code>***Function***
  @functions {
      public void deleteRecord(int id, Database db)
      {
          db.Execute("DROP INDEX "+id+"ON Students");
      }
  }
  
  ***Button calling that function***
  &lt;td&gt;&lt;button onclick="@deleteRecord(row.No, db)"&gt;Delete&lt;/button&gt;&lt;/td&gt;
  </code></pre>
  
  <p>db is declared earlier SQL database</p>