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

RadAjaxManager.GetCurrent(this.Page) returns null on secondary page

2 Answers 629 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
Paul
Top achievements
Rank 1
Paul asked on 22 Nov 2010, 06:04 PM
I have a master page that defines a RadAjaxManager :

  <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" DefaultLoadingPanelID="RadAjaxLoadingPanel1">
  </telerik:RadAjaxManager>

and in my secondary page I have a button click handler that calls:

RadAjaxManager.GetCurrent(this.Page).Redirect("ManageGroups.aspx");

This fails with a null reference exception since GetCurrent returns null despite there being a RadAjaxManager on the master page. I've tried adding a RadAjaxManagerProxy to the secondary page but that doesn't seem to have any effect. So far the only way I've found to get round this issue is to create an extra RadAjaxManager on the secondary page which isn't very efficient.

This is in a project that was converted from .NET 3.5 to 4.0 just in case that helps point to the issue.

2 Answers, 1 is accepted

Sort by
0
SamJ
Top achievements
Rank 1
answered on 23 Nov 2010, 07:50 AM
Hi,

Can you specify on which event are you calling the preceding code?
Also, please confirm that on the MasterPage you have a ScriptManager control declaration above this of the RadAjaxManager.
A possible reason for the RadAjaxManager not to be initialized properly is if it is declared before the script manager on the page.

Regards,
SamJ
0
Paul
Top achievements
Rank 1
answered on 23 Nov 2010, 05:34 PM
Thanks! I moved the ScriptManager declation to before the AjaxManager and hey presto everything works.
Tags
Ajax
Asked by
Paul
Top achievements
Rank 1
Answers by
SamJ
Top achievements
Rank 1
Paul
Top achievements
Rank 1
Share this question
or