Groups | Blog | Home
all groups > asp.net building controls > february 2004 >

asp.net building controls : Control added programmatically not firing event



Troy
2/29/2004 12:21:08 PM
Hi, I'm loading a usercontrol with image buttons into a panel. When clicking the buttons the click event does not fire. Any suggestions

Thanks
Tro
Troy
3/1/2004 7:56:05 AM
Alessandro
I was loading the UserControl into a panel based on a button click. Unfortunately, this didn't work. The UserControl never showed up. The UserControl is determined by a database record and associated fields with content for that control on button click. It seems to get this to work, I have to load the sub Get_UserControl, which provides the function described earlier, during the Page_Load event of the base page. When I do this, my button click event fires. But this is wrought with all kinds of problematic behavior, having to load Get_UserControl twice, once during the Page_Load event of the base page, and again within my UserControl dynamically loaded in the panel. Any thoughts

Troy

----- Alessandro Zifiglio wrote: ----

Provide some more details. At what stage of your pages life cycle are yo
loading the controls. In what method. Are you loading the controls based o
a button click


"Troy" <anonymous@discussions.microsoft.com> wrote in messag
news:E4F84195-4B48-4EB0-9E36-C2831377B3A0@microsoft.com..
[quoted text, click to view]
Alessandro Zifiglio
3/1/2004 10:43:26 AM
Provide some more details. At what stage of your pages life cycle are you
loading the controls. In what method. Are you loading the controls based on
a button click ?


[quoted text, click to view]

Alessandro Zifiglio
3/1/2004 9:00:02 PM
see if this old post helps resolve your issue

http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&oe=UTF-8&threadm=uwUUS155DHA.2576%40TK2MSFTNGP11.phx.gbl&rnum=1&prev=/groups%3Fq%3DDynamically%2Bloading%2Bascx%2Bpage%2Band%2Bhaving%2Bevents%2Bfire%26ie%3DUTF-8%26oe%3DUTF-8%26hl%3Den%26btnG%3DGoogle%2BSearch

[quoted text, click to view]
Unfortunately, this didn't work. The UserControl never showed up. The
UserControl is determined by a database record and associated fields with
content for that control on button click. It seems to get this to work, I
have to load the sub Get_UserControl, which provides the function described
earlier, during the Page_Load event of the base page. When I do this, my
button click event fires. But this is wrought with all kinds of problematic
behavior, having to load Get_UserControl twice, once during the Page_Load
event of the base page, and again within my UserControl dynamically loaded
in the panel. Any thoughts?
[quoted text, click to view]

AddThis Social Bookmark Button