Free programming examples and instructions

Calling server side events from html Button - Asp.net

Demo and code for how to call server events from html button in Asp.net

by Athil

Posted on 01 Jan 0001 Category: Asp.net Views: 984

Edited on 28 Jun 2019

Here I am going to show how to call server side events from HTML button.
By giving runat="server" onserverclick ="MyFunction" to HTML button we can call server  side events from html button


In client side

<form id="form1" runat="server">
          <input id="Submit1" runat="server" onserverclick ="MyFunction" type="submit" value="Click Me" />    

In Server Side 

public void MyFunction(object sender, EventArgs e)


Leave a Comment: