Hello,
I added a button from code and with it i added onclick event.
here is the code
Button button = new Button();
button.ID = link;
button.Text = "1";
button.Click += new System.EventHandler(this.button_Click);
private void button_Click(object sender, EventArgs e)
{
System.Web.UI.WebControls.Image im = new System.Web.UI.WebControls.Image();
im.ImageUrl = ((Button)sender).ID; //ID has image link
Form.Controls.Add(im);
}
When I run the page and press on the button it doesnt even run the function of button_click (checking using breakpoint..).
Why and how to fix this?
Thanks.