'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?
10 Answers, 1 is accepted
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
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,
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
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?
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
Any idea why?
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
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>
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
