Practically I don’t need it. But a little curiosity is running on my mind as my event handler function written for running in the server is not called. I have dragged a html button element and put it inside the form element with attribute runat=”server”
Now if I double click on the button inside design view, it redirects me to a javascript block on which the event handler function is created. I erased it and write my own in the code behind file. Now when run the page on the server and click on the button, the event handler function is not called.
I want it to be run. Any way ?
You are confusing between two different events: the onclick provided in the editor is the client side click event, handled with javascript code.
The server side, c# based event handler can be added to such a button if you markup it with
,attribute and add a server side handler to it (assuming Button1 is the id of your button)
the markup for the html input doesnt expose the server side event to add a handler through the markup, but you can add the code i pasted above within your page_load/init events