When a FORM runs at the server, its inner HTML is rewritten by ASP.NET. This is what appears to be happening:
-
ID and NAME properties are rewritten according to a predictable pattern. Two new JavaScript functions were added to deal with this design so external scripts can still be used. One of these functions is extremely inefficient as it loops through sets of objects hoping to find the right one renamed by ASP.NET.
-
The ACTION property is rewritten to make sure the form posts back to itself. This design “encourages” me to not roundtrip commands through the ACTION property. It also has nudged me into running HTML buttons at the server and using event delegates instead of commands embedded in query strings.
-
Using HTML buttons as server controls also means forms are no longer validated and submitted in JavaScript. Now they are only validated and either true or false is returned to a “listener”—usually the FORM connected to the ONSUBMIT property.