RadControls for ASP.NET AJAX Here are listed some of the common issues one can face when using RadAjax
Problem: Inline JavaScript in Dynamically Loaded User Controls is missing on the Page
Solution: Wrap the script block into RadScriptBlock. If the issue persists in your case, you ought to register the script through the ScriptManager.RegisterStartupScript() method
CopyASCX
<telerik:RadScriptBlock Id="RadScriptBlock1" runat="server">
<script type="text/javascript">
//your code here
</script>
</telerik:RadScriptBlock>
CopyC#
protected void Page_Load(object sender, EventArgs e)
{
ScriptManager.RegisterStartupScript(Page, typeof(Page), "dynamicScript", "function doSomething(){alert(1);}");
}
CopyVB.NET
Protected Sub Page_Load(sender as Object, e as EventArgs) Handles Me.Load
ScriptManager.RegisterStartupScript(Page, Page.GetType(), "dynamicScript", "function doSomething(){alert(1);}")
End SubProblem: Control Skin is not loaded after ajax.
Solution: This issue usually occurs when you are showing a sertain control after ajax or you are changing the Skin upon ajax. In this case, you should set the control EnableAjaxSkinRendering property true on Page_Load:
CopyC#
protected void Page_Load(object sender, EventArgs e)
{
RadCalendar1.EnableAjaxSkinRendring = true;
}
CopyVB.NET
Protected Sub Page_Load(sender as Object, e as EventArgs) Handles Me.Load
RadCalendar1.EnableAjaxSkinRendring = true
End SubProblem: Setting EventName in the ajax settings for the ajax initiator control does not work.
Solution: The EventName property is obsolete for RadAjax. If your logic strongly replies on it, you would use ASP:UpdatePanel to
ajaxify the controls instead of RadAjax. Anoter option is to wrap the updated control in a RadAjaxPanel instead of using
the RadAjaxManager to ajaxify it. Then on certain client-side event of the ajax initiator, invoke ajax for the corresponding RadAjaxPanel
manually. See the sample in this topic for more information.
Problem: Loading panel is not displayed if you invoke multiple requests from the same ajax initiator before the previous request finished.
Solution: Handler the RadAjaxmanager/RadAjaxPanel OnRequestStart client-side event as below:
CopyJavaScript
<telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
<script type="text/javascript">
function RequstStart() {
var obj = Sys.WebForms.PageRequestManager.getInstance();
if (obj.get_isInAsyncPostBack())
obj.abortPostBack();
}
</script>
</telerik:RadCodeBlock>