I've got a Button called ButtonCreator when you click on it a click event called ButtonCreator_OnClick is fired, inside the function I've created a button dynamically, now how do I create on click event for that button?
the code:
private void ButtonCreator_OnClick(object sender, EventArgs e)
{
Button button = new Button();
button.Click += (object s, EventArgs eb) => {};
}
now when I click on the button the page is post back and the control is gone, how do I make the function inside the event handler work?