title: How to add a event to a button using Razor?
body: <p>I am quite new to asp.net core development and I really don't know much of javascript, I am trying to know if there is some way to handle input events like OnClick() or OnChange() of Html inputs using only C#/Razor code <strong>without a form too</strong> and <strong>using only Razor Pages/MVC</strong> , Something Like this: </p>
  
  <pre><code>@{
      void RazorFunction()
       {
         //Do Stuff 
       }
  }    
  &lt;button Onclick="RazorFunction"/&gt;
  </code></pre>