How can a program capture generates events from a dynamically created button control in asp.net?
From stackoverflow
-
You can attach the event programmatically:
Button myButton = new Button(); myButton.Click += new ClickEventHandler...etc
-
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) { }
0 comments:
Post a Comment