Execute an event when a specific button inside a gridview is clicked
Hi
I have a list of buttons inside my gridview cells, now i need each button to execute a difrent event when its clicked. how can i solve this?
I tried to put this on Page_Load but not working
foreach (GridViewRow rowItem in GridView1.Rows)
{
Button btnMonday = (Button)(GridView1.Rows[0].Cells[1].FindControl("btnMonday"));
btnMonday.Click += new EventHandler(this.mondae_Click);
Button btnTuesday = (Button)(GridView1.Rows[0].Cells[2].FindControl("btnMonday"));
btnTuesday .Click += new EventHandler(this.mondae_Click);
}
What should i do or where should i put it??