This is a migrated thread and some comments may be shown as answers.

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

5 Answers 210 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
Mark
Top achievements
Rank 1
Mark asked on 17 Nov 2010, 11:10 AM
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>

5 Answers, 1 is accepted

Sort by
0
Radoslav
Telerik team
answered on 23 Nov 2010, 09:51 AM
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.
0
Roger
Top achievements
Rank 1
answered on 17 Jul 2011, 04:02 AM
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
0
Radoslav
Telerik team
answered on 20 Jul 2011, 11:42 AM
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!

0
أشرف
Top achievements
Rank 1
answered on 22 Dec 2013, 11:07 AM
You have to force the ClientIDMode property value to AutoID. Please view my reply here.
0
Roger
Top achievements
Rank 1
answered on 18 Oct 2016, 11:59 PM
Thank you!  This got me going:-)
Tags
Ajax
Asked by
Mark
Top achievements
Rank 1
Answers by
Radoslav
Telerik team
Roger
Top achievements
Rank 1
أشرف
Top achievements
Rank 1
Roger
Top achievements
Rank 1
Share this question
or