Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / Telerik MVC Extensions (superseded) > General Discussions > 'fx' is null or not an object error

Not answered 'fx' is null or not an object error

Feed from this thread
  • Tejas avatar

    Posted on Apr 1, 2011 (permalink)

    Whenever our MVC site detects Session timeout and Session timeout page is displayed, in bottom window we see javascript error:
    'fx' is null or not an object. All pages inherit from same _Layout.cshtml, but error happens only for Session timeout page. How can we resolve this?

    Reply

  • Atanas Korchev Atanas Korchev admin's avatar

    Posted on Apr 4, 2011 (permalink)

    Hi Tejas,

     Unfortunately this is not a known issue. Could it be that the Scripts folder is not excluded from ASP.NET authentication and as a result the JavaScript files fail to load? You can check with Fiddler or Firebug if there are any failing HTTP requests when there is a session timeout. Alternatively you can open a support ticket and send us a running sample project which reproduces the JavaScript error.

    Regards,
    Atanas Korchev
    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

    Reply

  • Tejas avatar

    Posted on Apr 11, 2011 (permalink)

    Hi Atanas,

    I will check with fiddler etc and let you know. However my general observation is whenever Session timeout happens and if I am debugging with scripts, 'fx' null or not an object error comes from telerik.window.min.js file.

    Thanks,

    Reply

  • Alex Gyoshev Alex Gyoshev avatar

    Posted on Apr 12, 2011 (permalink)

    Hello Tejas,

    This error may occur only if the telerik.window.js file is included before telerik.common.js or if the page calls the open() or close() methods of the window. Perhaps this information will help you with finding the issue.

    Kind regards,
    Alex Gyoshev
    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

    Reply

  • Tejas avatar

    Posted on Apr 12, 2011 (permalink)

    Alex,

    You are right. On a page where I get 'fx' is null or not an object, I checked the page source and telerik.common.js is not present.

    Here is my question:
    My web.config has:
    <telerik>
      <webAssets useTelerikContentDeliveryNetwork="true" /></telerik>


    My _layout.cshtml is like as follows:
    <!DOCTYPE html>
    <html>
    <head>
        <title>@ViewBag.Title</title>
        @(Html.Telerik().StyleSheetRegistrar().DefaultGroup(group => group.Add("telerik.common.css").Add("telerik.outlook.css").Combined(true).Compress(true)))
        <link href="@Url.Content("~/Content/Site.css")" rel="stylesheet" type="text/css" />
    </head>
    <body>
        <div class="page">
            <div id="header">
                      </div>
            <div id="main">
                            @RenderBody()
            </div>
            <div id="footer">
                @Html.Raw(@LocalizedText.FooterText)
            </div>
        </div>
        @(Html.Telerik().ScriptRegistrar()
                        .jQuery(true)
                        .Scripts(s => s.Add("~/Scripts/MicrosoftAjax.js")
                                       .Add("~/Scripts/MicrosoftMvcAjax.js")
                                       .Add("~/Scripts/jquery.unobtrusive-ajax.min.js")
                                       .Add("~/Scripts/2011.1.315/telerik.draganddrop.min.js")
                                       .Add("~/Scripts/2011.1.315/telerik.window.min.js")
                                       .Add("~/Scripts/json2.js")
                                       .Add("~/Scripts/Project.js"))
                        .DefaultGroup(group => group.Combined(true).Compress(true)))
    </body>
    </html>

    We are creating telerik window at client side (jQuery) as a result we have included window.js via ScriptRegistrar.
    I am realying on
    <telerik> <webAssets useTelerikContentDeliveryNetwork="true" /></telerik>


    to populate other .js files. However on a page where I get 'fx' error, source shows me .js files, I have in ScriptRegistrar.
    I don't see "common.js" in source.








    Do I have to include manually this file?




    Reply

  • Dimo Dimo admin's avatar

    Posted on Apr 13, 2011 (permalink)

    Hi Tejas,

    Yes, you have to include the telerik.common.js file manually, just like you are doing it for the other Telerik MVC JS files. Please refer to:

    http://www.telerik.com/help/aspnet-mvc/telerik-ui-components-required-javascript-files.html

    Kind regards,
    Dimo
    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

    Reply

  • Tejas avatar

    Posted on Apr 18, 2011 (permalink)

    Ok.. so now if I look at my html source, I see 2 telerik.common.min.js (one added by CDN and one I added by me) in most of the paged. However on Session Timeout page, common.js via CDN is missing.

    Any idea why?

    Reply

  • Dimo Dimo admin's avatar

    Posted on Apr 18, 2011 (permalink)

    Hi Tejas,

    Please check this forum thread:

    http://www.telerik.com/community/forums/aspnet-mvc/general/script-tag-rendered-twice.aspx#1609937

    Greetings,
    Dimo
    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

    Reply

  • Tejas avatar

    Posted on Apr 18, 2011 (permalink)

    Following the suggestion of the link, I don't even see what scripts gets added to my page: This section goes missing from view source.
    so I can't tell, if duplicate files gets added or not.

    <script type="text/javascript" src="http://aspnet-scripts.telerikstatic.com/mvcz/2011.1.315/jquery-1.5.1.min.js"></script>

     

     

    <

     

    script type="text/javascript" src="http://aspnet-scripts.telerikstatic.com/mvcz/2011.1.315/telerik.common.min.js"></script>

     

     

    <

     

    script type="text/javascript" src="http://aspnet-scripts.telerikstatic.com/mvcz/2011.1.315/telerik.panelbar.min.js"></script>

     

     

    <

     

    script type="text/javascript" src="http://aspnet-scripts.telerikstatic.com/mvcz/2011.1.315/telerik.list.min.js"></script>

     

     

    <

     

    script type="text/javascript" src="http://aspnet-scripts.telerikstatic.com/mvcz/2011.1.315/telerik.calendar.min.js"></script>

     

     

    <

     

    script type="text/javascript" src="http://aspnet-scripts.telerikstatic.com/mvcz/2011.1.315/telerik.datepicker.min.js"></script>

     

     

    <

     

    script type="text/javascript" src="http://aspnet-scripts.telerikstatic.com/mvcz/2011.1.315/telerik.textbox.min.js"></script>

     

     

    <

     

    script type="text/javascript" src="http://aspnet-scripts.telerikstatic.com/mvcz/2011.1.315/telerik.grid.min.js"></script>

     

     

    <

     

    script type="text/javascript" src="/Ecp/Scripts/MicrosoftAjax.debug.js"></script>

     

     

    <

     

    script type="text/javascript" src="/Ecp/Scripts/MicrosoftMvcAjax.debug.js"></script>

     

     

    <

     

    script type="text/javascript" src="/Ecp/Scripts/jquery.unobtrusive-ajax.min.js"></script>

     

     

    <

     

    script type="text/javascript" src="/Ecp/Scripts/2011.1.315/telerik.common.min.js"></script>

     

     

    <

     

    script type="text/javascript" src="/Ecp/Scripts/2011.1.315/telerik.draganddrop.min.js"></script>

     

     

    <

     

    script type="text/javascript" src="/Ecp/Scripts/2011.1.315/telerik.window.min.js"></script>

     


    <script type="text/javascript">

     

    //<![CDATA[

    jQuery(document).ready(

    function(){
    }

     

     

    //]]>

    </

     

    script>

     

    Reply

  • Dimo Dimo admin's avatar

    Posted on Apr 19, 2011 (permalink)

    Hi Tejas,

    I guess I was not clear enough in my previous replies.

    The ScriptRegistrar adds automatically to the page all script files required by Telerik MVC extensions, but only for those extensions that are displayed on initial page load. The ScriptRegistrar does not add script files for extensions that are displayed after an AJAX request.

    The jQuery source is registered on all pages, which have a ScriptRegistrar on them. The telerik.common.js file will be registered on all pages, which have at least one Telerik MVC extension (initially) on them.

    With this information in mind, please inspect once again your ScriptRegistrar configuration and check what script files should be added manually for components that are added with an AJAX request.

    Also check whether you are not trying to display a partial view as a standalone page.

    If your problem persists, please send us a standalone runnable demo for local inspection. Thanks.

    Best wishes,
    Dimo
    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

    Reply

  • Phillip avatar

    Posted on Jun 20, 2012 (permalink)

    Is there any way to get around it happening when you call page.open() or page.close()? I need to open a new page which should display a telerik chart.

    Reply

Back to Top

Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / Telerik MVC Extensions (superseded) > General Discussions > 'fx' is null or not an object error