Whack-a-mole javascript error.

8 posts, 0 answers
  1. Thomas
    Thomas avatar
    143 posts
    Member since:
    Feb 2007

    Posted 14 Nov 2007 Link to this post

    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.
  2. Thomas
    Thomas avatar
    143 posts
    Member since:
    Feb 2007

    Posted 14 Nov 2007 Link to this post

    The problem also occurs when I used just a RadWindow (as opposed to a RadWindowManager).
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Thomas
    Thomas avatar
    143 posts
    Member since:
    Feb 2007

    Posted 14 Nov 2007 Link to this post

    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.
  5. Georgi Tunev
    Admin
    Georgi Tunev avatar
    7207 posts

    Posted 15 Nov 2007 Link to this post

    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
  6. Thomas
    Thomas avatar
    143 posts
    Member since:
    Feb 2007

    Posted 15 Nov 2007 Link to this post

    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. 
  7. Georgi Tunev
    Admin
    Georgi Tunev avatar
    7207 posts

    Posted 20 Nov 2007 Link to this post

    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
  8. Thomas
    Thomas avatar
    143 posts
    Member since:
    Feb 2007

    Posted 20 Nov 2007 Link to this post

    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.
  9. Daniel Frumkin
    Daniel Frumkin avatar
    19 posts
    Member since:
    Jun 2004

    Posted 03 Mar 2008 Link to this post

    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.
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017