Welcome Guest Search | Active Topics | Sign In | Register

EO.Callback needs to be triggered by button in user control Options
cn
Posted: Wednesday, February 4, 2009 3:16:42 PM
Rank: Advanced Member
Groups: Member

Joined: 8/31/2008
Posts: 33
Hi,

I'm in the process of rewriting a web form that contains a callback panel. In the legacy version of the web form the callback's triggers were tied to asp:buttons located in the form. To simplify the page I moved the input form containing the buttons into a custom user control and added that control to the page inside the callback panel. How can I reference the buttons in the user control in the callback panel's triggers?

Thanks,
CN
eo_support
Posted: Wednesday, February 4, 2009 3:25:40 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
Hi,

You will not be able to. The Trigger and the CallbackPanel must be in the same coding unit (Page, UserControl, etc). So in this case you can use the UserControl as a trigger, but will not be able to use a Button inside the UserControl as a trigger.

There are two work arounds for this scenario:
1. You can always trigger the CallbackPanel from anywhere with JavaScript. But that may require even more code changes;
2. You can place a second CallbackPanel inside your UserControl, then set the button to trigger that second CallbackPanel, and also set both CallbackPanel's GroupName to the same value. That way the button will trigger the second CallbackPanel, which also causes the first CallbackPanel to update;

Hope this helps.

Thanks!
cn
Posted: Wednesday, February 4, 2009 3:31:41 PM
Rank: Advanced Member
Groups: Member

Joined: 8/31/2008
Posts: 33
Thanks.

Would be a possible to raise an event in my user control that triggers the callback panel. i.e. When the button is clicked in my user control I raise an event for the user control.

Thanks,
CN
eo_support
Posted: Wednesday, February 4, 2009 3:39:28 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
I do not think that will work if you are talking about server side event. The CallbackPanel must be triggered on the client side, so if you are already on the server side, it's already too late. The bottom line is the CallbackPanel provides you two ways to trigger it: through a trigger control or through JavaScript. Whatever else you may want to use, you will need to code to reach either of those two starting point first.
cn
Posted: Wednesday, February 4, 2009 3:42:08 PM
Rank: Advanced Member
Groups: Member

Joined: 8/31/2008
Posts: 33
Thanks, I understand now. I'll investigate the java script option.

- CN


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.