If you load your controls dynamically on asp.net 2.0 web site,you will face a problem that all handlers of server side controls doesn’t work and not fire on the server side.
Even you try to put a break point on your server side handler,it will not fire,this is not because of a problem on any of your user controls or your code has something wrong.
the problem is : if you try to write the same line of code on asp.net 1.1 web application this problem will not happen at all,and if you tru to load the same controls on asp.net 2.0 web site the problem will happen.
The solution and Tip for this problem,is to just give an ID for your user control which will be loaded dyamiccly,and the problem will not happen.
This the code which run on asp.net 1.1 perfectly and doesnt run on asp.net website :
Control c = Page.LoadControl(”UCPath”);
The Solution :
Control c = Page.LoadControl(”UCPat”);
c.ID = “IDForYourControl“;
Hope this helps.
Read more on the problem and the solution on Scott Blog :