AB Vyas AB Vyas - 18 days ago 4x
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) { }