This is a migrated thread and some comments may be shown as answers.

usercontrol trigger problem

2 Answers 96 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
Gary
Top achievements
Rank 1
Gary asked on 03 Oct 2008, 06:25 AM
I have the following scenario.  I have a master page with the scriptmanager and radajaxmanager on it.  On the master page I have two contentareas.  On the derived page I have a radajaxmanager proxy in the first of the two content areas.

On content area one is a treeview.  On content area two us an asp:panel[1] with a button and a second asp:panel[2].  We dyanimcally add usercontrols to the inner panel based upon the page mode.  Everything up to this point works fine.  When the page posts back, we recreate the user controls and everything works fine, in a general sense.

We have dynamically added the ajaxmanager action from the code which states, in short, that the button will update the treeview and asp:panel[2].  We have also added one (same exact criteria as the button) for the user control.  This works fine for the button.  I can click on this and changes are reflected in the treeview and asp:panel[2] just as expected. 

Now when the user control in asp:panel[2] does a postback using it's internally managed button (that is a button on the user control) the page posts back but only asp:panel[1] is updated.  The treeview is never updated to relfect the change.

I originally had these guys wrapped on radajaxpanel's but I read that this could be a problem.

So, the short question, seeing that I have ajaxmanager on the master page, and the ajaxmanagerproxy on the base page, how do I handle events within the user control that need to affect items at the base page?

I've tried adding another ajaxmanager to the user control but I simply don't have the reference to the base page treeview and panel data to create the callback.  I have tried manually putting the control names into the user control ajaxmanagerproxy but that did nothing (other than throw some javascript error (which I didn't log)).

Is there a simple way to acheive this?

2 Answers, 1 is accepted

Sort by
0
Gary
Top achievements
Rank 1
answered on 03 Oct 2008, 05:02 PM
Okay, I know the above probably sounds a little vague.  I setup a complete sample to demonstrate my problem with a master page, form and a user control.  Any actions on the user control does not update anything on the form page using ajax.  This is being done with radajaxmanager, radajaxmanagerproxy and asp:panel.

Sample project to demonstrate problem

If anyone could shine some light on this I would really appreciate it.

Thanks.
0
Maria Ilieva
Telerik team
answered on 06 Oct 2008, 10:03 AM
Hello Gary,

You could try to axaify the UserControl by using the original RadAjaxManager form the MasterPage. For this purpose you should use GetCurrent method. For example:

RadAjaxManager.GetCurrent(Page)

For more information on this matter you could review the following help topic.

All the best,
Maria Ilieva
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
Ajax
Asked by
Gary
Top achievements
Rank 1
Answers by
Gary
Top achievements
Rank 1
Maria Ilieva
Telerik team
Share this question
or