Hello!
i have attached my code below.
<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" OnAjaxRequest="RadAjaxManager1_AjaxRequest">
<AjaxSettings>
<telerik:AjaxSetting AjaxControlID="RadAjaxManager1">
<UpdatedControls>
<telerik:AjaxUpdatedControl ControlID="panel1" />
<telerik:AjaxUpdatedControl ControlID="samplediv" />
</UpdatedControls>
</telerik:AjaxSetting>
</AjaxSettings>
<AjaxSettings>
<telerik:AjaxSetting AjaxControlID="Timer1" >
<UpdatedControls>
<telerik:AjaxUpdatedControl ControlID="samplediv" />
<telerik:AjaxUpdatedControl ControlID="ajaxbtn" />
</UpdatedControls>
</telerik:AjaxSetting>
</AjaxSettings>
</telerik:RadAjaxManager>
<br />
<asp:Panel ID="panel1" runat="server">
<asp:Timer ID="Timer1" runat="server" Interval="2000" ontick="Timer1_Tick" Enabled="false">
</asp:Timer></asp:Panel>
<div id="samplediv" runat="server" style="border:solid 1px grey;height:180px;width:250px;overflow:scroll;" />
<telerik:RadCodeBlock ID="radblk" runat="server">
<script type="text/javascript">
function chattext()
{
var ajaxmagr = $find("<%=RadAjaxManager1.ClientID%>");
alert(ajaxmagr);
ajaxmagr.ajaxRequest("chat");
}
</script>
</telerik:RadCodeBlock>
cs code..
protected void Timer1_Tick(object sender, EventArgs e)
{
string s = "chattext();";
RadScriptManager.RegisterStartupScript(this, this.GetType(), "s", s, true);
}
protected void RadAjaxManager1_AjaxRequest(object sender, AjaxRequestEventArgs e)
{
if (e.Argument == "chat")
{
samplediv.InnerHtml += " sample text <br/>";
}
}
i want to call a js funtion in timer tick. but i got ajaxmgr as null in js alert.
whats wrong in my code?
thanks.
priya.
i have attached my code below.
<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" OnAjaxRequest="RadAjaxManager1_AjaxRequest">
<AjaxSettings>
<telerik:AjaxSetting AjaxControlID="RadAjaxManager1">
<UpdatedControls>
<telerik:AjaxUpdatedControl ControlID="panel1" />
<telerik:AjaxUpdatedControl ControlID="samplediv" />
</UpdatedControls>
</telerik:AjaxSetting>
</AjaxSettings>
<AjaxSettings>
<telerik:AjaxSetting AjaxControlID="Timer1" >
<UpdatedControls>
<telerik:AjaxUpdatedControl ControlID="samplediv" />
<telerik:AjaxUpdatedControl ControlID="ajaxbtn" />
</UpdatedControls>
</telerik:AjaxSetting>
</AjaxSettings>
</telerik:RadAjaxManager>
<br />
<asp:Panel ID="panel1" runat="server">
<asp:Timer ID="Timer1" runat="server" Interval="2000" ontick="Timer1_Tick" Enabled="false">
</asp:Timer></asp:Panel>
<div id="samplediv" runat="server" style="border:solid 1px grey;height:180px;width:250px;overflow:scroll;" />
<telerik:RadCodeBlock ID="radblk" runat="server">
<script type="text/javascript">
function chattext()
{
var ajaxmagr = $find("<%=RadAjaxManager1.ClientID%>");
alert(ajaxmagr);
ajaxmagr.ajaxRequest("chat");
}
</script>
</telerik:RadCodeBlock>
cs code..
protected void Timer1_Tick(object sender, EventArgs e)
{
string s = "chattext();";
RadScriptManager.RegisterStartupScript(this, this.GetType(), "s", s, true);
}
protected void RadAjaxManager1_AjaxRequest(object sender, AjaxRequestEventArgs e)
{
if (e.Argument == "chat")
{
samplediv.InnerHtml += " sample text <br/>";
}
}
i want to call a js funtion in timer tick. but i got ajaxmgr as null in js alert.
whats wrong in my code?
thanks.
priya.