Hi, I have an ascx file that contains a RadNotification and a timer.
<
telerik:RadCodeBlock
ID
=
"RadCodeBlock1"
runat
=
"server"
>
<
script
type
=
"text/javascript"
>
function OnClientUpdated(sender, args) {
sender.show()
$find("<%= RadAjaxManager.GetCurrent(Page).ClientID %>").ajaxRequest("content");
}
function UpdateWithoutPopup() {
var ajaxManager = $find("<%= RadAjaxManager.GetCurrent(Page).ClientID %>");
ajaxManager.ajaxRequest(arguments);
}
</
script
>
</
telerik:RadCodeBlock
>
<
telerik:RadAjaxManagerProxy
ID
=
"AjaxManagerProxy1"
runat
=
"server"
>
<
AjaxSettings
>
<
telerik:AjaxSetting
AjaxControlID
=
"Timer1"
>
<
UpdatedControls
>
<
telerik:AjaxUpdatedControl
ControlID
=
"RadNotification1"
/>
</
UpdatedControls
>
</
telerik:AjaxSetting
>
</
AjaxSettings
>
</
telerik:RadAjaxManagerProxy
>
<
asp:Timer
ID
=
"Timer1"
runat
=
"server"
Interval
=
"6000"
OnTick
=
"Timer1_Tick"
/>
<
telerik:RadNotification
RenderMode
=
"Lightweight"
id
=
"RadNotification1"
runat
=
"server"
loadcontenton
=
"EveryShow"
width
=
"300"
height
=
"150"
animation
=
"Fade"
enableroundedcorners
=
"true"
enableshadow
=
"true"
title
=
"Received messages"
offsetx
=
"-20"
offsety
=
"-20"
onclientupdated
=
"OnClientUpdated"
titleicon
=
"none"
autoclosedelay
=
"5000"
Skin
=
"Bootstrap"
>
<
ContentTemplate
>
<
asp:Image
ID
=
"Image1"
runat
=
"server"
CssClass
=
"Max75"
/>
<
asp:Literal
ID
=
"lbl"
runat
=
"server"
></
asp:Literal
>
</
ContentTemplate
>
</
telerik:RadNotification
>
the timer makes the checks and if necessary displays a popup, another calls a function
public
void
Timer1_Tick(
object
sender, EventArgs e)
{
if
(Check())
{
RadNotification1.Show();
}
else
{
string
script =
"UpdateWithoutPopup()"
;
ScriptManager.RegisterStartupScript(Page,
typeof
(Page),
"myscript"
, script,
true
);
}
}
When I show the popup everything works fine when if I call the error function I get the error:
default.aspx:502 Uncaught TypeError: Cannot read property 'ajaxRequest' of null
how do I fix?
thanks in advance