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

AJAX Manager Proxy used in user controls

1 Answer 86 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
saurabh
Top achievements
Rank 1
saurabh asked on 27 Jan 2009, 05:50 PM
Hi,
I have a Master page in my application which contains RadAjaxManager. One of the page that uses base page has two user controls. And both the user controls have RadAjaxManagerProxy. both the userControls have different javascript methods that use:-

var ajaxManager =  $find("<%= RadAjaxManager.GetCurrent(Page).ClientID %>");
ajaxManager.ajaxRequest("ARGUMENTS");

and in the Page_Load of both the userControls ajaxRequest is wired to different events, like in userCtrl_1
    protected void Page_Load(object sender, EventArgs e)
    {
        RadAjaxManager manager = RadAjaxManager.GetCurrent(Page);
        manager.AjaxRequest += new RadAjaxControl.AjaxRequestDelegate(RadAjaxManagerUC_Ctrl_1);
    }
and in userCtrl2 pageLoad is something like this:-
    protected void Page_Load(object sender, EventArgs e)
    {
        RadAjaxManager manager = RadAjaxManager.GetCurrent(Page);
        manager.AjaxRequest += new RadAjaxControl.AjaxRequestDelegate(RadAjaxManagerUC_Ctrl_2);
    }

My problem is when I use both the user controls in the same page. and say userCtrl_1 fires its client side ajaxRequest the apart from execution of RadAjaxManagerUC_Ctrl_1, the second method RadAjaxManagerUC_Ctrl_2 also gets executed. Even though userControl_2 did not do anything.


1 Answer, 1 is accepted

Sort by
0
Dimo
Telerik team
answered on 28 Jan 2009, 01:39 PM
Hello Saurabh,

As far as I can see, the RadAjaxManager control behaves correctly and exactly as you have told it. In order to prevent unnecessary handler execution, you can perform some checks, for example - check what arguments are passed from the AJAX request in each handler.

Sincerely yours,
Dimo
the Telerik team

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