How to handle onclick event in a listview button?

asp.net, listview, onclick

Solution

You can use CommandArgument property of the button control to specify which button clicked.

This example shows how to get values from command argument within listview control.

Problem

If I have listview control with a button in the item template, how do I handle the onclick events for each of the buttons that ends up getting generated in the listview?

Original source