Reg: Dynamic button click event is not firing. RRS feed

  • Question

  • Hi Friends,

    i have a doubt.

    I have created a  dynamic  button on button click event one modal popup has to open .

    Button Creation :

    Button btnDynamic = new Button();
                                    btnDynamic.Text = "Test Button";
                                    btnDynamic.ID = "btn" + dataColumn.ColumnName.Replace(" ", "");
                                    btnDynamic.Click += new EventHandler(this.btnDynamic_Click);

    Button Event:

     protected void btnDynamic_Click(object sender, EventArgs e)
            //Modal pop up has to open

    But above event is not firing.

    And how to pass modalpoup :TargetControlID place this dynamic button id we have to place .

    But dynamic button will be create at run time.

    Please provide me any suggestion/solution.

    Monday, November 25, 2013 5:40 AM