So wierd... RadAjaxManager throwing error w/ MasterPages

7 posts, 0 answers
  1. Michael
    Michael avatar
    84 posts
    Member since:
    May 2008

    Posted 17 Apr 2011 Link to this post

    Ok...

    I stripped my code down to the bare minimum and it still is not working!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

    I am getting Error: i.get_postBackElement() is undefined

    Get this, SAME code WORKS when I don't use a MasterPage. When I DO use a MasterPage, it's broken!!!

    <%@ Master Language="C#" AutoEventWireup="true" CodeFile="MasterPage2.master.cs" Inherits="MasterPages_MasterPage2" %>
     
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
     
    <head runat="server">
        <title></title>
        <asp:ContentPlaceHolder id="head" runat="server">
        </asp:ContentPlaceHolder>
    </head>
    <body>
        <form id="form1" runat="server">
        <telerik:RadScriptManager ID="RadScriptManager1" runat="server" />
        <div>
            <asp:ContentPlaceHolder id="ContentPlaceHolder1" runat="server">
             
            </asp:ContentPlaceHolder>
        </div>
     
        </form>
    </body>
    </html>
     
    using System;
     
    public partial class MasterPages_MasterPage2 : System.Web.UI.MasterPage
    {
        protected void Page_Load(object sender, EventArgs e)
        {
     
        }
    }

    And my aspx page:

    <%@ Page Title="" Language="C#" MasterPageFile="~/MasterPages/MasterPage2.master" AutoEventWireup="true" CodeFile="Default3.aspx.cs" Inherits="Default3" %>
     
    <asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
    </asp:Content>
     
    <asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
        <asp:LinkButton ID="lb1" runat="server" OnClick="lb1_Click" Text="push" />
        <asp:Label ID="lbl1" runat="server" Text="test" />
     
     
        <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" EnableAJAX="true" UpdatePanelsRenderMode="Inline">
            <AjaxSettings>
                <telerik:AjaxSetting AjaxControlID="lb1">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="lbl1" />
                    </UpdatedControls>
                </telerik:AjaxSetting>
            </AjaxSettings>
        </telerik:RadAjaxManager>
    </asp:Content>
     
    using System;
     
    public partial class Default3 : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
     
        }
     
        protected void lb1_Click(object sender, EventArgs e)
        {
            lbl1.Text = "pushed";
        }
    }

    The above doesn't work.

    But this WORKS!

    <%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default2.aspx.cs" Inherits="Default2" %>
     
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
     
    <head runat="server">
        <title></title>
    </head>
    <body>
    <form id="form1" runat="server">
    <telerik:RadScriptManager ID="RadScriptManager1" runat="server" />
         
    <asp:LinkButton ID="lb1" runat="server" OnClick="lb1_Click" Text="push" />
    <asp:Label ID="lbl1" runat="server" Text="test" />
     
    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" EnableAJAX="true" UpdatePanelsRenderMode="Inline">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="lb1">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="lbl1" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>
    </form>
    </body>
    </html>
     
    using System;
     
    public partial class Default2 : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
     
        }
     
        protected void lb1_Click(object sender, EventArgs e)
        {
            lbl1.Text = "pushed";
        }
    }

    What gives? :(

    I have been using RadControls for many many years. The environment is Windows 7 using .Net 4 integrated mode.
  2. Michael
    Michael avatar
    84 posts
    Member since:
    May 2008

    Posted 17 Apr 2011 Link to this post

    Ok after further tests, I found 3 things that caused this error.

    1. <pages clientIDMode="Static" /> causes this error
    2. AJaxControlToolkit (even with the <scripts> entries in the RadScriptManager
    3. Also I moved the viewstate to the bottom of the page on page "Render"

    If at least 1 of those things above were present, the RadAjax was throwing the JS error.

    2 and 3 I can live without. But I would really like to use clientIDMode="Static". Any ideas?
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Robert Poole
    Robert Poole avatar
    1 posts
    Member since:
    Mar 2005

    Posted 19 Apr 2011 Link to this post

    I have been pulling my hair out for the last two hours experiencing the same error. After reading Michael's post, I removed a reference to the AJAX Control Toolkit to my project, and presto, it works fine. There is some conflict here. Luckily, I don't need the Toolkit for this project, but Telerik please look into what is causing this.
  5. Tsvetina
    Admin
    Tsvetina avatar
    1873 posts

    Posted 21 Apr 2011 Link to this post

    Hello,

    To your questions:

    Michael, currently RadControls for ASP.NET AJAX do not offer support for ClientIDMode different than AutoID. Since these are controls with complex hierarchies of child controls and templates, setting their ClientID mode to Static will break their functionality. Please note that Microsoft does not recommend setting ClientIDMode="Static" on pages which do contain dynamic controls.

    Robert, there have been some incompatibilities between the RadControls suite and the AjaxControlToolkit which should not be present with the latest versions of both suites. With previous versions, some adjustments were needed, most of them are described in the following forum thread:
    AJAX Control Toolkit Compatability

    However, if compatibility problems persist on your side, I would advise you to open a formal support ticket and send a runnable sample of your configuration, we will adjust it to work without errors.

    Best wishes,
    Tsvetina
    the Telerik team

    Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

  6. Faten
    Faten avatar
    3 posts
    Member since:
    Dec 2011

    Posted 04 Feb 2013 Link to this post

    Micheal , can you please describe in more details point 3 ???? I have the same problem & i'm not using Ajax toolkit nor static client id mode.. i didn't get your third point .. what have you done exactly with viewstate ??
  7. Michael
    Michael avatar
    84 posts
    Member since:
    May 2008

    Posted 04 Feb 2013 Link to this post

    Basically I moved the viewstate to the bottom of the page, and this caused issues. It's a bit of a task to move the viewstate to the bottom so I doubt many people would have done this, but if you happened to have done that, that caused issues.
  8. Oliver
    Oliver avatar
    4 posts
    Member since:
    Dec 2011

    Posted 16 Jun 2013 Link to this post

    Hi all,

    I ran into the same problem. Same code not working in nested page, but worked without changes in a standard (non nested) page.

    I found a workaround (for me), that could possibly give anybody a helping hand, when facing the same problem.

    (My) conclusion:
    I replaced every standard asp-control with its corresponding telerik version, which I defined as a trigger in RadAjaxManager.
    e.g. asp:button into radButton, asp:DropDownList into radDropDownList ... etc...
    After I replaced my controls, everything worked like expected, even within a nested page. I don't know exactly why, but perhaps the support has a guess to share with us?

    Best regards
    Oliver


Back to Top
UI for ASP.NET Ajax is Ready for VS 2017