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

Javascript Error when Ajax Manager and Loading panel on page...

6 Answers 119 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
mark baer
Top achievements
Rank 1
mark baer asked on 18 Mar 2011, 05:57 PM
I have a fairly complex ajax page with an Accordian(AJAX Toolkit), a RadGrid in the upper level of the accordian and Grid Item Details in the lower part of the accordian.  When the user selects an item in the grid, the accordian changes and shows the details in the bottom part of the accordian.

I have a Search "Div" on the page.  When the user clicks "Search", it searchs for results, then collapses/expands the Accordian to show the results in the grid(upper accordian level).

I tried adding the RadAjax Manager and Loading Panel to the page.  When the User clicks the Search Button, the RadLoading Panel shows up over the Details form and that works.  But then I get a Javascript error message:

Microsoft JScript runtime error: 'document.getElementById(...)' is null or not an object

document.getElementsByTagName("head")[0].appendChild(b)

If I remove the RadAjax Loading panel and Manager, the error goes away.  Here is my HTML for the RadAjax Manager and Loading Panel:

<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server"><br>        <AjaxSettings><br>            <telerik:AjaxSetting AjaxControlID="btnSearch1"><br>                <UpdatedControls><br>                    <telerik:AjaxUpdatedControl ControlID="upScriptDetail" LoadingPanelID="RadAjaxLoadingPanel1" /><br>                </UpdatedControls><br>            </telerik:AjaxSetting><br>            <telerik:AjaxSetting AjaxControlID="btnSearch"><br>                <UpdatedControls><br>                    <telerik:AjaxUpdatedControl ControlID="upScriptDetail" LoadingPanelID="RadAjaxLoadingPanel1" /><br>                </UpdatedControls><br>            </telerik:AjaxSetting><br>        </AjaxSettings><br></telerik:RadAjaxManager>


Here is my code behind for showing the search results.
 if (result.Count > 0)<br> {<br>         //expand the search results...<br>         this.CollapsiblePanelExtender1.Collapsed = false;<br>         this.CollapsiblePanelExtender1.ClientState = "false";<br>         //collapse the details...<br>         this.CollapsiblePanelExtender2.Collapsed = true;<br>         this.CollapsiblePanelExtender2.ClientState = "true";<br><br>         bindSearchResults(result);<br>         radgridSearchResults.DataBind();<br> }<br><br> private void bindSearchResults(List<CreativeSearchDataService.ScriptSearchResult> searchResults)<br> {<br>      radgridSearchResults.SelectedIndexes.Clear();   //reset just in case this is a new search...<br>      radgridSearchResults.DataSource = searchResults;<br>      radgridSearchResults.MasterTableView.DataKeyNames = new string[] { "id" };<br> }


Any help would be greatly appreciated.

thanks


6 Answers, 1 is accepted

Sort by
0
Maria Ilieva
Telerik team
answered on 23 Mar 2011, 02:21 PM
Hello Mark,

Could you please let me know if the issue appear when a AjaxToolkit ScriptManager is used on the page. Also note that when RadScriptManager is used You need to reference the MicrosoftAjax.js and MicrosoftAjaxWebForms.js through RadScriptManager:

<telerik:RadScriptManager runat="server">  
    <Scripts>  
        <asp:ScriptReference Assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" 
            Name="MicrosoftAjax.js" Path="Scripts-40412/MicrosoftAjax.js" />  
        <asp:ScriptReference Assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" 
            Name="MicrosoftAjaxWebForms.js" Path="Scripts-40412/MicrosoftAjaxWebForms.js" />  
    </Scripts>  
</telerik:RadScriptManager>
The script files are obtained by building the ACT from source.


Best wishes,
Maria Ilieva
the Telerik team
0
mark baer
Top achievements
Rank 1
answered on 23 Mar 2011, 09:11 PM
Is this for .NET 3.5?  I have a .NET 4.0 Project.  I just upgraded from the Demo Tools to your Live Version.  I am still having the problem.  I'm not sure where to get the Microsoft JS files.  In your message, it says get them from the Source Build?  Is that for the Ajax Toolkit?  I don't see them on my system anywhere.  Besides, is that just for .NET 3.5 or is that .NET 4.0 as well.

Thanks
0
mark baer
Top achievements
Rank 1
answered on 23 Mar 2011, 09:15 PM
I tried putting the Ajax Script manager back instead of the RadScriptManager and I didn't get any errors, but it didn't do anything.

thanks

mark
0
Maria Ilieva
Telerik team
answered on 29 Mar 2011, 08:33 AM
Hi Mark,

What exactly do you mean by "but it didn't do anything". Do the Ajax requests stop to work when AjaxScriptManager is used? It will be very helpful if you could open a regular support ticket and send us runnable version of your application. Thus we will be able to test it locally and do our best to provide proper solution.


Regards,
Maria Ilieva
the Telerik team
0
Atlas
Top achievements
Rank 1
answered on 29 Mar 2011, 10:43 PM

Hey Maria,
you indicated the following in your response: "when RadScriptManager is used You need to reference the MicrosoftAjax.js and MicrosoftAjaxWebForms.js through RadScriptManager:"

I was wondering if you are implying that it is now a requirement for all RadScriptManager tags?
I have not heard of this before, but we have been updating our Telerik dll's on a regular basis.

I don't see the Microsoft Ajax references being used in your demos?

http://demos.telerik.com/aspnet-ajax/fileexplorer/examples/server-sideapi/initialpathandpaging/defaultcs.aspx

Could you please clarify?

Also, please note, I created a new ASP.Net web project in .Net 3.5 and one in ASP.Net 4.0, and dragged a RadScriptManager onto the design view of the default page, and no JavaScript files were added to the RadScriptManager in either case. All I got was:

<telerik:RadScriptManager ID="RadScriptManager1" runat="server"></telerik:RadScriptManager>

I also created a new Telerik C# Web Application in ASP.Net 3.5, and it adds the following RadScriptManager to the page.

<telerik:RadScriptManager ID="RadScriptManager1" runat="server">
    <Scripts>
        <%--Needed for JavaScript IntelliSense in VS2010--%>
        <%--For VS2008 replace RadScriptManager with ScriptManager--%>
        <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>

but no Microsoft files???

0
Maria Ilieva
Telerik team
answered on 01 Apr 2011, 02:13 PM
Hi Nano,

The mentioned Microsoft.js files need to be referenced only in cases AjaxToolkit controls are used on the page in collaboration with RadAjax not in every single application. If you are still experiencing issues with the project and have additional questions it will be very helpful if you could open a regular support ticket and send us runnable version of your application. Thus we will be able to test it locally and do our best to provide proper solution.



Greetings,
Maria Ilieva
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
Ajax
Asked by
mark baer
Top achievements
Rank 1
Answers by
Maria Ilieva
Telerik team
mark baer
Top achievements
Rank 1
Atlas
Top achievements
Rank 1
Share this question
or