AB Vyas AB Vyas - 5 months ago 30
ASP.NET (C#) Question

How can i create dynamic button click event on dynamic button?

I am creating one button on page dynamically.
Now I want to use button click event on that button.

How can I do this in c# asp.net?

Button button = new Button();
button.Click += (s,e) => { your code; };
//button.Click += new EventHandler(button_Click);

//protected void button_Click (object sender, EventArgs e) { }