How can a program capture generates events from a dynamically created button control in asp.net?
views:
291answers:
2
+2
A:
You can attach the event programmatically:
Button myButton = new Button();
myButton.Click += new ClickEventHandler...etc
FlySwat
2008-12-06 05:40:05
A:
Button ButtonDeleteFromDB = new Button();
ButtonDeleteFromDB.Text = "Delete";
ButtonDeleteFromDB.ID = "btnDeleteFromDB" + ctrlCount.ToString();
ButtonDeleteFromDB.Click += new EventHandler(ButtonDeleteFromDB_Click);
Call the event in foll manner :
private void ButtonDeleteFromDB_Click(object sender, EventArgs e) { }
Samiksha
2008-12-08 06:09:56