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

refresh ajaxmanager

2 Answers 62 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Kaushal
Top achievements
Rank 1
Kaushal asked on 12 Jul 2012, 09:51 PM
Hi,

On my page (aspx). I have this code

RadAjaxManager ajaxManager = RadAjaxManager.GetCurrent(Page);
 ajaxManager.AjaxRequest += new RadAjaxControl.AjaxRequestDelegate(this.RadAjaxManager1_AjaxRequest);

I load a user control dynamically

var ucToolMfgInfo = (UserControls_ToolsDetailsMfgInfoUC)Page.LoadControl("~/Tools/UserControls/ToolsDetailsMfgInfoUC.ascx");

This user control has button which opens a radwindow. The javascript on this user control is on radscriptblock. When the radwindow open, On the radwindow, when I click submit button, it saves data and then  it calls function from aspx page to refresh the browserwindow. It is browserwindow.refeshGridComponent. I can get the alert test111 but the ajaxmanager does not refresh and it does not call RadAjaxmanager_ajaxrequest function to update the grid on the user control.
function refreshGridComponent(arg, arg1) {
                alert('test111');
                var ajaxManager = $find("<%= RadAjaxManager.GetCurrent(this.Page).ClientID %>");
                ajaxManager.ajaxRequest("Component"); 
            }

In the Radajaxmanager_ajaxrequest function on aspx page

protected void RadAjaxManager1_AjaxRequest(object sender, AjaxRequestEventArgs e)
{
   try
   {
          if (e.Argument == "Component")
                    LoadUserControls("A3");
    }
}

Any help is appreciated.

Thanks.

2 Answers, 1 is accepted

Sort by
0
Kaushal
Top achievements
Rank 1
answered on 16 Jul 2012, 08:56 PM
Nobody is here to help ???? Where is the support team?
0
Andrey
Telerik team
answered on 17 Jul 2012, 12:21 PM
Hello,

Most probably this behavior is caused by the fact that GetCurrent method could not find the instance of the RadAjaxManager control.

You could verify this assumption by placing a debugger after the alert function and examine the value of the ajaxManager variable.

Additionally, please note that the response time is not guaranteed for forums. When posting a thread in forums you are relying mostly on the community.

All the best,
Andrey
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Tags
General Discussions
Asked by
Kaushal
Top achievements
Rank 1
Answers by
Kaushal
Top achievements
Rank 1
Andrey
Telerik team
Share this question
or