RadAjaxManager: Microsoft JScript runtime error: 'get_postBackElement().id' is null or not an object

6 posts, 0 answers
  1. Mark
    Mark avatar
    8 posts
    Member since:
    Nov 2008

    Posted 17 Nov 2010 Link to this post

    I am gettting the following error when using RadAjaxManager and an asp:LinkButton. 

    Microsoft JScript runtime error: 'get_postBackElement().id' is null or not an object

    However, if I invoke an Ajax call using the addNewClient button, and then I try and click the deleteClientLinkButton everything works fine.  It is just on the first page load that the error is thrown.

    If I set ClientIdMode = AutoID for the page (http://www.telerik.com/community/forums/aspnet-ajax/ajax/radajax-broken-in-vs-2010-beta-2-in-master-content-pages.aspx) then the LinkButton works properly.  However, this renames all my controls and all my CSS is broken and no longer works.

    Help please...

    <asp:Content ID="Content1" ContentPlaceHolderID="headerContentPlaceholder" runat="Server">
        <script type="text/javascript">
            $(document).ready(function () {
                SetElements();
            });
     
            function SetElements() {
                //addNewClient
                $('#addNewClient').click(function () {
                    $('#addNewClient').attr("disabled", true);
                    $('#mainContentPlaceholder_newClientContainer').slideDown(function () {
                        $('#mainContentPlaceholder_newClientContainer').show();
                    });
                });
                //cancel
                $('#cancel').click(function () {
                    $('#addNewClient').removeAttr("disabled");
                    $('#mainContentPlaceholder_newClientContainer').slideUp();
                });
                //close
                $('#close').click(function () {
                    $('#mainContentPlaceholder_notificationContainer').fadeOut();
                    $('#notificationContainer').fadeOut();
                });
            };
     
            function ResponseEnd(sender, eventArgs) {
                SetElements();
                Cufon.replace('h1');
                Cufon.replace('h2');
                Cufon.now();
            };
     
        </script>
    </asp:Content>
    <asp:Content ID="Content2" ContentPlaceHolderID="mainContentPlaceholder" runat="Server">
        <div id="leftContainer" runat="server">
            <h1>
                Clients
            </h1>
            <div id="notificationContainer" runat="server" visible="false">
                <asp:Literal ID="notificationLiteral" runat="server" /><span><a href="#" id="close"></a></span></div>
            <%--<uc1:Notifications ID="notifications" runat="server" />--%>
            <div id="navigation">
                <a id="addNewClient" href="#" class="button hex2C608F">Add New Client</a>
            </div>
            <div id="newClientContainer" class="extra-b5" runat="server">
                <table class="clientDetailsTable" cellspacing="0" cellpadding="0">
                    <tr>
                        <td>
                            <h4 class="extra-b5">
                                Client Details</h4>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <asp:Label ID="clientNameLabel" runat="server" Text="Client Name" /><br />
                            <asp:TextBox ID="clientNameTextBox" runat="server" CssClass="textbox short" MaxLength="50" />
                            <asp:RequiredFieldValidator ID="clientNameRequiredValidator" runat="server" ErrorMessage="Please enter a client name."
                                Display="None" ControlToValidate="clientNameTextBox" ValidationGroup="newClientGroup" />
                        </td>
                        <td>
                            <asp:Label ID="themeLabel" runat="server" Text="Theme" /><br />
                            <asp:DropDownList ID="themeDropDownList" runat="server" AppendDataBoundItems="true"
                                CssClass="short">
                                <asp:ListItem Value="-1">-- Please Select --</asp:ListItem>
                            </asp:DropDownList>
                        </td>
                        <td>
                        </td>
                    </tr>
                    <tr>
                        <td colspan="2">
                            <asp:Button ID="addClientButton" runat="server" Text="Add" OnClick="addClientButton_Click"
                                ValidationGroup="newClientGroup" />
                            or <a id="cancel" href="#">Cancel</a>
                        </td>
                    </tr>
                </table>
                <asp:ValidationSummary ID="newClientValidationSummary" runat="server" ShowMessageBox="true"
                    ShowSummary="false" ValidationGroup="newClientGroup" />
            </div>
            <asp:ListView ID="clientsListView" runat="server">
                <LayoutTemplate>
                    <ul class="list1">
                        <div id="itemPlaceholder" runat="server" class="list1">
                        </div>
                    </ul>
                </LayoutTemplate>
                <ItemTemplate>
                    <li>
                        <%# Eval("Name") %><div class="options">
                            <a href="ClientDetails.aspx?ClientId=<%# Eval("Id") %>">Edit</a><span class="separator">|</span>
                            <asp:LinkButton ID="deleteClientLinkButton" runat="server" OnCommand="DeleteClient"
                                CommandArgument='<%# Eval("Id") %>' OnClientClick="return confirm('Are you sure you want to delete this client?')"
                                Text="Delete" />
                            <%--<a href="ManageClients.aspx?ClientId=<%# Eval("Id") %>" onclick="return confirm('Are you sure you want to delete this client?')">Delete</a></div>--%>
                    </li>
                </ItemTemplate>
            </asp:ListView>
        </div>
        <div id="rightContainer" runat="server">
            <h1>
                Placeholder
            </h1>
            <h4 class="extra-b12">
                Integer in metus sapien.</h4>
            <p>
                Praesent diam tellus, congue nec pellentesque dictum, convallis non dui. Nam tincidunt
                tempor lectus quis placerat. Pellentesque habitant morbi tristique senectus et netus
                et malesuada fames ac turpis egestas. Proin condimentum posuere nisl, ut mollis
                metus mollis at.</p>
            <p>
                Integer in metus sapien. Maecenas aliquet porttitor nisl, a rhoncus ligula pellentesque
                at. Maecenas tempor odio ut dolor pharetra faucibus. Cras in massa a odio vulputate
                ultricies ac non purus. Etiam in orci nibh, quis dictum ante. In hac habitasse platea
                dictumst.</p>
        </div>
        <telerik:RadAjaxManagerProxy ID="RadAjaxManagerProxy1" runat="server">
            <AjaxSettings>
                <telerik:AjaxSetting AjaxControlID="addClientButton">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="leftContainer" />
                    </UpdatedControls>
                </telerik:AjaxSetting>
                <telerik:AjaxSetting AjaxControlID="deleteClientLinkButton">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="leftContainer" />
                    </UpdatedControls>
                </telerik:AjaxSetting>
            </AjaxSettings>
        </telerik:RadAjaxManagerProxy>
        <telerik:RadAjaxLoadingPanel ID="radAjaxLoadingPanel" runat="server" Skin="Vista">
        </telerik:RadAjaxLoadingPanel>
    </asp:Content>
  2. Radoslav
    Admin
    Radoslav avatar
    1564 posts

    Posted 23 Nov 2010 Link to this post

    Hi Mark,

    Unfortunately the described problem is related with the .Net Framework and like the Pavel said into the mentioned forum post there is little we can do to fix it. Additionally you could try replacing the RadScriptManager with asp:ScriptManager and let me know if the issue still persists. Also you could try moving the javascript code form the headerContentPlaceholder into the mainContentPlaceholder and around it with RadCodeBlock. I suggest you to place the RadAjaxManagerProxy on the top of the mainContentPlaceholder.

    Best wishes,
    Radoslav
    the Telerik team
    Browse the vast support resources we have to jumpstart 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.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Roger
    Roger avatar
    183 posts
    Member since:
    Sep 2007

    Posted 16 Jul 2011 Link to this post

    Hi,
    I've just been given a template from the designer to incorporate in my wab app and it uses Cufon.
    I installed it on the master page and had exactly the same problems mentioned.
    I followed your suggestion of putting it on the content page between RadscriptBlock's and it works fine.

    thanks for that
  5. Radoslav
    Admin
    Radoslav avatar
    1564 posts

    Posted 20 Jul 2011 Link to this post

    Hi Roger,

    I am glad that you achieved the desired functionality. In case you experience any further problems, do not hesitate to contact us.

    Greetings,
    Radoslav
    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!

  6. Ashraf Sabry
    Ashraf Sabry avatar
    88 posts
    Member since:
    Jan 2011

    Posted 22 Dec 2013 Link to this post

    You have to force the ClientIDMode property value to AutoID. Please view my reply here.
  7. Roger
    Roger avatar
    5 posts
    Member since:
    Aug 2007

    Posted 18 Oct in reply to Ashraf Sabry Link to this post

    Thank you!  This got me going:-)
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017