'undefined' is null or not an object

3 posts, 0 answers
  1. Richard Weeks
    Richard Weeks avatar
    95 posts
    Member since:
    Oct 2009

    Posted 21 Jul 2011 Link to this post

    Hello,

    I have an existing master page that has worked without issue for a number of applications for a long time.

    I (late to the party) added a RadAjaxLoadingPanel with a RadAjaxManager:

    Navigating to a page with a RadGrid in the child page within the MainUpdatePanel, I see the Ajax loading image while the grid is waiting for results. However, when the grid finishes receiving the results (I think), I see a number of modal alerts with the following web page error:

    Error: 'undefined' is null or not an object

    This repeats then the page displays without any content rendered within the MainUpdatePanel area.

    Clicking a RadMenu link in the header to navigate results in:

    Error: Object required

    Then navigation to the requested page proceeds with no other issue.

    Can you help me to identify the cause? I have reproduced the issue with the following Master Page stripped of unnecessary items (no code-behind required).

    Master Page

    <%@ Master Language="C#" AutoEventWireup="true" CodeBehind="SiteMaster.master.cs" Inherits="SampleWebApplication.SiteMaster" %>
    <%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <head>
        <title>Test</title>
    </head>
    <body>
        <form id="MainForm" runat="server">
      
            <telerik:RadScriptManager ID="TelerikScriptManager" runat="server">
                <Scripts>
                    <%--Needed for JavaScript IntelliSense in VS2010--%>
                    <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:RadAjaxManager ID="TelerikAjaxManager" runat="server">
                <AjaxSettings>
                    <telerik:AjaxSetting AjaxControlID="MainUpdatePanel">
                        <UpdatedControls>
                            <telerik:AjaxUpdatedControl ControlID="MainUpdatePanel" LoadingPanelID="TelerikAjaxLoadingPanel" />
                        </UpdatedControls>
                    </telerik:AjaxSetting>
                </AjaxSettings>
            </telerik:RadAjaxManager>
      
            <telerik:RadMenu ID="MajorNavMenu" runat="server">
                <CollapseAnimation Duration="200" Type="OutQuint" />
                <ExpandAnimation Type="None" />
                <Items>
                    <telerik:RadMenuItem runat="server" NavigateUrl="~/Default.aspx" Text="Home"></telerik:RadMenuItem>
                </Items>
            </telerik:RadMenu>
      
            <asp:UpdatePanel ID="MainUpdatePanel" runat="server">
                <ContentTemplate>
      
                    <asp:ContentPlaceHolder ID="MainContentPlaceHolder" runat="server">
                    </asp:ContentPlaceHolder>
      
                </ContentTemplate>
            </asp:UpdatePanel>
      
            <telerik:RadAjaxLoadingPanel ID="TelerikAjaxLoadingPanel" runat="server">
            </telerik:RadAjaxLoadingPanel>
      
        </form>
    </body>
    </html>

    Content Page

    <%@ Page Title="Home" Language="C#" MasterPageFile="~/SiteMaster.Master" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="SampleWebApplication.Default" %>
    <%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
      
    <asp:Content ID="MainContent" ContentPlaceHolderID="MainContentPlaceHolder" runat="server">
      
        <asp:Button 
            id="DoSearch" 
            runat="server" 
            Text="Search" 
            OnClick="DoSearch_OnClick" 
            Width="195">
        </asp:Button>
      
        <telerik:RadGrid ID="SearchResults" runat="server" AutoGenerateColumns="False" CellSpacing="0" GridLines="None">
            <MasterTableView DataKeyNames="TestValue">
                <CommandItemSettings ExportToPdfText="Export to PDF"></CommandItemSettings>
                <RowIndicatorColumn FilterControlAltText="Filter RowIndicator column">
                </RowIndicatorColumn>
                <ExpandCollapseColumn FilterControlAltText="Filter ExpandColumn column">
                </ExpandCollapseColumn>
                <Columns>
                    <telerik:GridBoundColumn DataField="TestValue" HeaderText="Test Value">
                    </telerik:GridBoundColumn>
                </Columns>
                <EditFormSettings>
                    <EditColumn FilterControlAltText="Filter EditCommandColumn column">
                    </EditColumn>
                </EditFormSettings>
            </MasterTableView>
            <FilterMenu EnableImageSprites="False">
            </FilterMenu>
            <HeaderContextMenu CssClass="GridContextMenu GridContextMenu_Default">
            </HeaderContextMenu>
        </telerik:RadGrid>
      
    </asp:Content>

    Content Page Code-behind

    namespace SampleWebApplication
    {
        using System;
      
        public partial class Default : System.Web.UI.Page
        {
            private readonly dynamic testData = new[]
            {
                new { TestValue = "Test Value 1" },
                new { TestValue = "Test Value 2" },
                new { TestValue = "Test Value 3" },
                new { TestValue = "Test Value 4" },
                new { TestValue = "Test Value 5" },
                new { TestValue = "Test Value 6" },
                new { TestValue = "Test Value 7" },
                new { TestValue = "Test Value 8" },
                new { TestValue = "Test Value 9" },
                new { TestValue = "Test Value 10" }
            };
      
            protected void DoSearch_OnClick(object sender, EventArgs e)
            {
                this.SearchResults.DataSource = testData;
                this.SearchResults.DataBind();
            }
        }
    }

    Thank you!

    Richard
  2. Maria Ilieva
    Admin
    Maria Ilieva avatar
    4017 posts

    Posted 26 Jul 2011 Link to this post

    Hi Richard,

    I tried top replicate the described issue locally using your code but to no avail. Also note that it is not supported scenario to have asp UpdatePanel controls added into the RadAjaxManager settings. Please replace the UpdatePanels with regalar asp panels and verify of this makes any difference

    Greetings,
    Maria Ilieva
    the Telerik team

    Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Maria Ilieva
    Admin
    Maria Ilieva avatar
    4017 posts

    Posted 26 Jul 2011 Link to this post

    Hi Richard,

    I tried top replicate the described issue locally using your code but to no avail. Also note that it is not supported scenario to have asp UpdatePanel controls added into the RadAjaxManager settings. Please replace the UpdatePanels with regalar asp panels and verify of this makes any difference

    Greetings,
    Maria Ilieva
    the Telerik team

    Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

Back to Top