Hi Telerik team
I have blow code and i delcare a javascript function in web page that contain a few jquery function . i wana to call it from code behind but when use it i get error .
please help me .
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="Default" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<
html
xmlns
=
"http://www.w3.org/1999/xhtml"
>
<
head
runat
=
"server"
>
<
title
></
title
>
<
telerik:RadStyleSheetManager
ID
=
"RadStyleSheetManager1"
runat
=
"server"
/>
<
style
type
=
"text/css"
>
#msg {
width: 400px;
height: 200px;
background-color: fuchsia;
color: blueviolet;
font-size: 16px;
display: none;
}
</
style
>
</
head
>
<
body
>
<
form
id
=
"form1"
runat
=
"server"
>
<
telerik:RadScriptManager
ID
=
"RadScriptManager1"
runat
=
"server"
>
<
Scripts
>
<
asp:ScriptReference
Assembly
=
"Telerik.Web.UI"
Name
=
"Telerik.Web.UI.Common.Core.js"
/>
<
asp:ScriptReference
Assembly
=
"Telerik.Web.UI"
Name
=
"Telerik.Web.UI.Common.jQuery.js"
/>
<
asp:ScriptReference
Assembly
=
"Telerik.Web.UI"
Name
=
"Telerik.Web.UI.Common.jQueryInclude.js"
/>
</
Scripts
>
</
telerik:RadScriptManager
>
<
telerik:RadScriptBlock
ID
=
"RadScriptBlock1"
runat
=
"server"
>
<
script
type
=
"text/javascript"
>
(function ($) {
$(document).ready(function () {
function showmsg() {
$("#msg").show(2000).delay(3000).hide(2000);
}
});
})($telerik.$);
</
script
>
</
telerik:RadScriptBlock
>
<
telerik:RadAjaxManager
ID
=
"RadAjaxManager1"
runat
=
"server"
>
<
AjaxSettings
>
<
telerik:AjaxSetting
AjaxControlID
=
"RadButton1"
>
</
telerik:AjaxSetting
>
<
telerik:AjaxSetting
AjaxControlID
=
"RadButton1"
>
<
UpdatedControls
>
<
telerik:AjaxUpdatedControl
ControlID
=
"RadButton1"
UpdatePanelCssClass
=
""
></
telerik:AjaxUpdatedControl
>
</
UpdatedControls
>
</
telerik:AjaxSetting
>
</
AjaxSettings
>
</
telerik:RadAjaxManager
>
<
div
>
<
telerik:RadButton
ID
=
"RadButton1"
runat
=
"server"
Text
=
"RadButton"
OnClick
=
"RadButton1_Click"
>
</
telerik:RadButton
>
</
div
>
<
div
id
=
"msg"
>
Hi Telerik team...
</
div
>
</
form
>
</
body
>
</
html
>
protected void RadButton1_Click(object sender, EventArgs e)
{
System.Threading.Thread.Sleep(1000);
ScriptManager.RegisterStartupScript(this.Page, Page.GetType(), "text", "showmsg();", true);
}