Saturday, January 16, 2010

C# event not fired on click event of dynamic controls?

i have created couple of dynamic controls (dropdownlist and imagebutton) in webuser controls and assigned selected index change event and image button clicked. I am giving names to control dyanmically.





My problem is : somtime it does not recognise click event of image button and selected index change event.C# event not fired on click event of dynamic controls?
After you have created to control and added it to the controls collection you have to:





Define the function you want to have fired of


public void myFunc( sender s, event args e)


You must get the return type and arguments the same as all the others.





Then you add this function to the OnClick event delegate:


myDynamiclyCreatedControl.OnClick += myFunc;
  • skin
  • No comments:

    Post a Comment