This is not as expected: <%@ Page %> <html> <script runat="server"> void OnButtonClick (object o, EventArgs args) { Console.WriteLine ("called"); } </script> <body> <form runat="server"> <input runat="server" id="reply" type="Button"<!-- instead of Submit--> onserverclick="OnButtonClick" value="Reply"> </form> </body> </html>