Hi,
Is it possible to create RadAjaxManager in codebehind?
I have a master page and I am creating a RadAjaxManager in the OnInit method of the master page. Later when I try to ajaxify a control within an aspx page using the AddAjaxSettings method I created in master page I get Object reference not set to an instance of an object.
Master Page
ASPX page
Edit: I get the null reference error in
Thank you...
Is it possible to create RadAjaxManager in codebehind?
I have a master page and I am creating a RadAjaxManager in the OnInit method of the master page. Later when I try to ajaxify a control within an aspx page using the AddAjaxSettings method I created in master page I get Object reference not set to an instance of an object.
Master Page
protected
override
void
OnInit(EventArgs e)
{
HtmlForm form = (HtmlForm)
this
.Controls[3];
form.Controls.Add(
new
RadAjaxManager());
}
public
void
AddAjaxSetting(Control ajaxified, Control updated, RadAjaxLoadingPanel loading)
{
HtmlForm form = (HtmlForm)
this
.Controls[3];
RadAjaxManager ajax = form.Controls[1]
as
RadAjaxManager;
ajax.AjaxSettings.AddAjaxSetting(ajaxified, updated, loading);
}
ASPX page
protected
void
Page_Load(
object
sender, EventArgs e)
{
(
this
.Master
as
PortalMaster).AddAjaxSetting(button, panel, loading);
}
Edit: I get the null reference error in
ajax.AjaxSettings.AddAjaxSetting(ajaxified, updated, loading);
line. All variables are pointing to correct objects (ajax, button, panel, loading).Thank you...