RadAjax Error !!!

3 posts, 0 answers
  1. hongnguyenx
    hongnguyenx avatar
    20 posts
    Member since:
    Dec 2006

    Posted 13 Oct 2009 Link to this post

    Hi all,
    I have one problem when use RadAjax for control Ajax action in my webpage

    My example project have home.aspx page and userControl, and userControl will be load on home page.
    In my home page i added RadScriptManager, RadAjaxManager, and usercotrol I added RadAjaxManagerProxy
    I done follow an example demo Ajax / User Controls/Master pages,
    But When I load home page I get an error - You can see it in image that I attach below :(
    I don't know that wrong in here
    Please help me, I'm thnks so much :D

    Code in Home.aspx

    <%@ Import Namespace ="iHRPCore.Com"%>
    <%@ Import Namespace ="System.Data" %>
    <%@ Import Namespace ="System.Data.SqlClient" %>
    <%@ Register TagPrefix="uc1" TagName="Table1_bottom" Src="Include/Table1_bottom.ascx" %>
    <%@ Register TagPrefix="uc1" TagName="Table1_top" Src="Include/Table1_top.ascx" %>
    <%@ Register TagPrefix="uc1" TagName="HeaderText_bottom" Src="Include/HeaderText_bottom.ascx" %>
    <%@ Register TagPrefix="uc1" TagName="HeaderText_top" Src="Include/HeaderText_top.ascx" %>
    <%@ Page language="c#" Codebehind="Editpage.aspx.cs" AutoEventWireup="false" Inherits="iHRPCore.Editpage" validateRequest="false" %>

    <%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
    <%@ Register TagPrefix="uc1" TagName="Top" Src="Include/Top1.ascx" %>
    <%@ Register TagPrefix="uc1" TagName="LeftMenu" Src="Include/LeftMenu.ascx" %>
    <%@ Register TagPrefix="uc1" TagName="Bottom" Src="Include/Bottom.ascx" %>
    <%@ Register TagPrefix="uc1" TagName="Bottom_LS" Src="Include/Bottom_LS.ascx" %>
    <%@ Register TagPrefix="cc1" Namespace="EeekSoft.Web" Assembly="EeekSoft.Web.PopupWin" %>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
            <title>Human resource and Payroll - fpt.iHRPCore</title>
            <meta content="Microsoft Visual Studio .NET 7.1" name="GENERATOR" />
            <meta content="C#" name="CODE_LANGUAGE" />
            <meta content="JavaScript" name="vs_defaultClientScript" />
            <meta content="http://schemas.microsoft.com/intellisense/ie8" name="vs_targetSchema" />
            <link href="Include/myStyles.css" type="text/css" rel="stylesheet" />
        <body bottomMargin="0px" leftMargin="0px" topMargin="0px" onload="ShowForm(<%=blnShowForm%>)" rightMargin="0px">
            <form id="Form1" method="post" runat="server">
            <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
            <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">

    And userControl.ascx code:

    <%@ Control Language="C#" AutoEventWireup="true" CodeBehind="HS_TiepNhan.ascx.cs" Inherits="FPT.DNN.Modules.PML.HS_TiepNhan" %>
    <%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
    <%@ Register Assembly="jQueryDatePicker" Namespace="Westwind.Web.Controls" TagPrefix="ww" %>
    <link href="../../../INC/PML.css" type="text/css" rel="stylesheet" />
    <telerik:RadAjaxManagerProxy ID="RadAjaxManagerProxy1" runat="server">
            <telerik:AjaxSetting AjaxControlID="ddlLoaiHoSo">
                    <telerik:AjaxUpdatedControl ControlID="grdHSKT" />
            <telerik:AjaxSetting AjaxControlID="grdHSKT">
                    <telerik:AjaxUpdatedControl ControlID="grdHSKT" />

    <input id="msg_hidden" type="hidden" name="msg_hidden" runat="server" />

    <script type="text/javascript" src="../../../INC/Common.js"></script>

    <script type="text/javascript">
        var sPath = '<%= Request.ApplicationPath + "/DESKTOPMODULES/PML/Images/" %>'
        function soNgayLeave() {
            UseCallback(document.getElementById('<%= txtSoNgayGiaiQuyet.ClientID %>').value,'');
        function OnCallback(result, context) {
            document.getElementById('<%= txtNgayHenTra.ClientID %>').value = result;alert(result);

    <asp:DropDownList ID="ddlLoaiHoSo" runat="server" Width="300px"

    <telerik:RadGrid ID="grdHSKT" runat="server" ></telerik:RadGrid>


  2. Pavlina
    Pavlina avatar
    6069 posts

    Posted 13 Oct 2009 Link to this post


    RadCodeBlock should be used when you have server code blocks placed within the markup (most often some JavaScript functions accessing server controls). RadCodeBlock prevents the server error:
    System.Web.HttpException: The Controls collection cannot be modified because the control contains code blocks (i.e. <% ... %>).
    For additional information please review this help article

    All the best,

    the Telerik team


    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  3. DevCraft R3 2016 release webinar banner
  4. hongnguyenx
    hongnguyenx avatar
    20 posts
    Member since:
    Dec 2006

    Posted 15 Oct 2009 Link to this post

    Hi Sir,
    Thnks so much for yours helping !!! I will try with it !!! :D
Back to Top