Click here to Skip to main content
15,891,136 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Dynamically button not firing while the button click from panel.

What I have tried:

btn_Reply.ID = "btn_ReplyUser" + i;
btn_Reply.Text = "Reply";
btn_Reply.Width = 250;
btn_Reply.AutoPostBack = true;
btn_Reply.Command += new CommandEventHandler(btn_Reply_command);
btn_Reply.Click += new System.EventHandler(btn_ReplyUser);
btn_Reply.CausesValidation=false;
this.form1.Controls.Add(btn_Reply)
pnlpopup.Controls.Add(btn_Reply)

private void btn_ReplyUser(object sender, EventArgs e)
{
//throw new NotImplementedException();
TextBox txt_re = new TextBox();
txt_re.Text = "Hello";
}
Posted
Updated 17-Jul-16 23:45pm
Comments
F-ES Sitecore 18-Jul-16 4:16am    
Are you running the code that creates the button on every page_load, even postbacks?
Member 12638851 19-Jul-16 0:42am    
while page load the button should be displayed and when we click button it should fire in separate method friend

1 solution

Hi friend You button Id name and your method Name should be same. I thing in your dynamic button id simultaneously changing so that not fire your button. while generating button name should be change method name.
 
Share this answer
 
Comments
Member 12638851 19-Jul-16 2:00am    
hi friend even i tried what u said it's also not working

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900