When you point the tag to runat="server" , you will inform the server of the tag registration. Now the tag is included in the control / tag tree on the server and can be found on the server: when an event is triggered or when attributes or content are changed on the server side.
Events on the client side are silently converted to the POST form. Together with additional information, such as the identifier of the control and the type of event.
Since your tag is registered on the server, it has an identifier that is also passed to the client (look at the html source). This tree is created (by parsing the .aspx file) before the event is fired. Using this identifier, you can find the tag in the control tree / tag on the server side and run the method that is used to process the event.
Using this technique and a lot of ViewState, Asp.Net tries to deny the nature of HTTP without attack. At first it looks like a good idea, IMHO, it is better not to fight with nature. Currently, ASP.Net MVC feels more natural.
source share