Whats the difference between Button.Click Event and Button.Command Event in asp.net?
+1
A:
As the documentation implies, the Buccon.Command event allows you to specify a "command" so that you can differentiate between which button was clicked, etc.
Bryce Fischer
2010-09-24 19:24:18
Can you provide a real world example, please?
user279521
2010-09-24 19:31:44
Well, one common example that has been useful to me is a grid where each row has a button (or link) for "Edit" or "Delete". Specify those values for the "Command" and then you know which button was clicked
Bryce Fischer
2010-09-24 19:38:10
Adding to Bryce's comment, you would use the command so you can have one method (Some generic event handler) that handles all buttons. (at least this is how i use it) You just use a switch: case; to determine what type of button was clicked and determine what to do from there. You could call another method or just do the work, whatever..
EJC
2010-09-24 19:43:37
user279521
2010-09-25 13:57:27