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

Whack-a-mole javascript error.

7 Answers 358 Views
Window
This is a migrated thread and some comments may be shown as answers.
Thomas
Top achievements
Rank 1
Thomas asked on 14 Nov 2007, 11:26 PM
I'm running into an odd whack-a-mole type error. I have the following:
Master Page containing
    User control which itself contains a single RadPanelBar (a left nav menu)
Page with Master set to above and:
    Main content area has:
        5 standard DropDownLists
        2 standard TextBoxes
        1 standard Button control
        1 RadGrid
        
I have the ASP.NET AJAX Extensions installed and the AJAX Control Toolkit installed. I'm using 2007.2.1107 of the Prometheus controls.        
        
The problem occurs when I put a Prometheus RadWindowManager in the user control referenced in the left content area on the master page. In all cases, the problem only occurs on a postback. Initial load of the page in all cases works fine. I'm using Firebug to track down the error however I also get it in IE7.

With no asp:ScriptManager located anywhere, I obviously get the yellow screen of death and something to the effect that the ScriptManager is missing.

If I put the asp:ScriptManager in the Master page, initial load works fine, however clicking the button (i.e. firing a postback) gives me a "Telerik is not defined" javascript error.

If I put the asp:ScriptManager in the user control, I get a "Sys is not defined" error.

If I put the asp:ScriptManager in content area on the Page in question, I get "Telerik is not defined".

My preference obviously would be to put the ScriptManager on the master page.

7 Answers, 1 is accepted

Sort by
0
Thomas
Top achievements
Rank 1
answered on 14 Nov 2007, 11:33 PM
The problem also occurs when I used just a RadWindow (as opposed to a RadWindowManager).
0
Thomas
Top achievements
Rank 1
answered on 15 Nov 2007, 12:01 AM
Just to add to the intrigue (and I realize this might now expand outside of the Window control), if on the Page in question I add a Prometheus RadAjaxManager with one AjaxSetting between two of the DropDownLists, I get a "h is not a constructor" javascript error.
0
Georgi Tunev
Telerik team
answered on 15 Nov 2007, 11:39 AM
Hello Thomas,

I am afraid that the provided information is not enough for us to determine what is the exact reason for the problem. To be able to help we will need the following:
  1. A small sample project that shows your real application's setup - please make sure that the project can be run locally and send it to us in a new support ticket (you cannot attach files in the forum)
  2. Detailed description of the observed behavior and the desired one.

Once we have a better view over your case, we will do our best to help.



Kind regards,
Georgi Tunev
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Thomas
Top achievements
Rank 1
answered on 15 Nov 2007, 07:40 PM
I have submitted a support ticket with a test project. I will say that putting together test projects is a pain. The reason relates to problems I regularly run into applying Telerik samples to my own problem. Some of those problems include (in no particular order):

1. Skins/Themes (meaning the skin itself causing an issue)
2. Controls on UserControls
3. Controls in ContentAreas (due to a MasterPage)
4. Controls in UserControls in ContentAreas  (due to a MasterPage).
5. Binding to objects instead of DataTables.
6. CSS styles

Thus, when I provide a sample, I try to ensure that all of these things are in play so that you can better isolate the problem which makes the process of creating a sample project cumbersome but hopefully makes it easier for you folks to track down the error. Anyway, I realize this is a bit of a rant, but what I'm trying to get at is that while Telerik's support is impeccable, hopefully you are including many of the above variables in your test scripts. 
0
Georgi Tunev
Telerik team
answered on 20 Nov 2007, 04:21 PM
Hello again Thomas,

I see that Tsvetie has already answered your support ticket. For convenience I am pasting her replies below:


Regarding the js error that you get - it is caused by the following directive(LeftNav.ascx):
<%@ OutputCache Duration="3600" VaryByParam="none" %> 
When you use this directive, the HTML string that is sent from the server to the client is cached. After a postback, the code for the Control is not executed but rather the string that is sent to the client is taken from the cache. However, our controls need to register all necessary js files in the HEAD of the page, which in turn is not cached. Thus, after you click the Search button, merely an HTML string is sent to the client for the LeftNav control, the js files are not registered and as a result, you get "'Telerik' is undefined".

In case you remove that line or add an instance of the RadWindow control to the ContractSearch.aspx, you will not get the js error.

The controls, that are part of the Prometheus suite are built on top of the MS Ajax framework and ASP.NET AJAX in general does not work in this case (please have a look the this forum thread for example). That is why in the same scenario you will get the same behavior with any of the Prometheus controls.



Regarding the problem that you cannot open a RadWindow - you cannot use the radopen method, as you do not have a RadWindowManager on the page, but a RadWindow. You can open it the following way:
    function ShowWindow()  
    {  
        var oWnd = $find('<%= WindowPageWindow.ClientID %>');  
        oWnd.show();  
    } 








Regards,
Georgi Tunev
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Thomas
Top achievements
Rank 1
answered on 21 Nov 2007, 01:22 AM
Ouch. I have to disable Output caching on every page with a Prometheus control? I realize that this problem is not caused by Telerik, but seriously...ouch.
0
Daniel Frumkin
Top achievements
Rank 1
answered on 03 Mar 2008, 04:54 PM
Thanks!
This solved a lot of my problems!

It would be FANTASTIC if you could build a custom output cache handler that caught errors like this and wrote them to a log file.
Seems like there's a lot of js errors that crop up when using a number of different ajax controls on a complicated page.
Tags
Window
Asked by
Thomas
Top achievements
Rank 1
Answers by
Thomas
Top achievements
Rank 1
Georgi Tunev
Telerik team
Daniel Frumkin
Top achievements
Rank 1
Share this question
or