M
Matias Woloski
Hi, I am creating a custom server control, and it dynamically creates lots
of LinkButtons, and then I try to subscribe to the click event doing this:
LinkButton link = new LinkButton();
link.Click +=new EventHandler(this.MyLinks_Click);
When I then click on the link, it never invokes MyLinks_Clicks... I guess
this happens because I don't create the linkbuttons neither on
CreateChildControls() nor OnInit(). I create them depending on some input
data and some properties.
All that MyLinks(...) does is set a property to a value, depending on the
linkbutton pressed, beacuse I need it when I render again my control.
Can someone give me a hint on how to solve this problem? Maybe instead of
subscribing to the event, I can catch the name of the linkbutton that caused
the PostBack or something.
Thanks
of LinkButtons, and then I try to subscribe to the click event doing this:
LinkButton link = new LinkButton();
link.Click +=new EventHandler(this.MyLinks_Click);
When I then click on the link, it never invokes MyLinks_Clicks... I guess
this happens because I don't create the linkbuttons neither on
CreateChildControls() nor OnInit(). I create them depending on some input
data and some properties.
All that MyLinks(...) does is set a property to a value, depending on the
linkbutton pressed, beacuse I need it when I render again my control.
Can someone give me a hint on how to solve this problem? Maybe instead of
subscribing to the event, I can catch the name of the linkbutton that caused
the PostBack or something.
Thanks