ASP.NET - Dynamically created button
<p>I have added a dynamically created button in my Webform. But its click event is not working. Can anyone please explain why?</p>

<p>This is my code:</p>

<pre><code>    Button save = new Button();
    save.ID = "btnSave";
    save.Text = "Save";
    save.Click += new System.EventHandler(this.Save_Click);
    Webform.Controls.Add(save);

protected void Save_Click(object sender, EventArgs e)
{

    Response.Redirect("Default.aspx");
}
</code></pre>

<p>Its coming back to the same page itself. It is not redirecting to Default.aspx.</p>
