hi,i create one button runtime and put in placeholder when i click on that it passes event handler to button_Click method.in that i call one function.when click on it
but it execute only once .
when button click n no. of times i want it execute that no of times but it not execute.
Thias is happening even button take drag & drop i.e not runtime.please help?
How button event listen at runtime
2 Answers
Know the answer? Post it. Somebody with the same question will find it here.

Guest UserRank #1,422 · 1.2K reputationPosted Mar 9, 2011, 3:31 PM EST
Button myButton = new Button();
myButton.Click += new EventHandler(myButton_Click);
void myButton_Click(object sender, EventArgs e)
{
throw new NotImplementedException();
}
(Just reviewed your code) The code that assigns the event handler to myButton.Click must execute during every postback - try putting it in Page_Load.
Suthish NairRank #92 · 22.8K reputationPosted Mar 10, 2011, 9:03 AM EST