Hi everybody!
Does anybody know how ca I add a web control dynamically in my asp.net page, for example Button. And I have a method which should be assigned to this button as a click handler.
I tried to do following: btn.click += new EventHandler(this.MyMethod); in onInit method of my page and then in Render method to add this button to my form. It apeared but click event didn't work.
So the problem is with dynamic event assigning.
Any ideas?
Thank you,
Alex
Does anybody know how ca I add a web control dynamically in my asp.net page, for example Button. And I have a method which should be assigned to this button as a click handler.
I tried to do following: btn.click += new EventHandler(this.MyMethod); in onInit method of my page and then in Render method to add this button to my form. It apeared but click event didn't work.
So the problem is with dynamic event assigning.
Any ideas?
Thank you,
Alex