I'm not sure if this is the right forum for this, (I posted this also in the Config / Deploy forum) but can anyone tell me why I often get a "Can not init Button", "Can not init Tab", "Can Not init Grid" java scritp error message?
Often I get the little "warning" error message in the bottom left corner of IE. If I double click the yellow "yield sign" I'll get a message that tells me basically that at Char N Line X can not init control. Then the browser window stops responding to all javascrip, I can't click a button, double click a grid view row, etc.
When viewing the source of the page, I see the javascript Try/Catches and the error message, but I still don't know what is causing it.
Has anyone seen this before, any ideas on what could cause it and what I can do to fix it.
Thanks
-- Joe --
This can occur due to numerous causes but is usually due to the same problem. The message you report usually entails that the scripts for the controls are not being loaded and when the intialization scripts are run, the functions for initializing cannot be found. What is the context of the behavior you see? Did you just upgrade? Is this a brand me application? What version of our controls are you using in what development environment?
For a quick fix (that may not fix your issue ) you can just redirect the scripts by using the technique in the following Knowledge Base:
http://devcenter.infragistics.com/Support/KnowledgeBaseArticle.aspx?ArticleID=6158
Also, make sure you do not have the JavaScriptFileName and JavaScriptFileName properties set if you are working with the CLR 2.0 or CLR 3.5 NetAdvantage controls. This will ensure that the control uses the scripts that are embedded as resources in the dlls. In CLR 1.x this is necesssary as the scripts are not embedded.
If you are runnign this through IIS, there is a setting that needs to be set for files with axd extensions so that the embedded resources can be used.
If you get this intermittently then it may have somethign to do with errors in your script or possibly something to do with AJAX if you are using any. Again, a lot of this depends on the context in which the error occurs.
We are running Version=6.3.20063.1072. The application is a little over a year old. What is the reallly frustrating part is that this problem doesn't always happen. In fact it is pretty infrequent, but when it does happen it prevents my users from effectively using the page.
And it only seems to affect users at our remote sites. From my office where the web server is located 20 feet from me I never see the "Can't init" error.
The context in which these errors happens varies widely, but usually when loading a grid with data. Users are assigned cases and each case is a record in their worklist (grid).
I'll take a look at that KB article. Can you tell me which setting in IIS that needs to be set to allow the axd extensions to work properly? Not using any Ajax, but I do make use of the Async ability of the WebTab and use Warp panels on a couple of other pages.
I don't think that it is a script error, simply because I can open the user's worklist on my PC and have no problem, then PC Anywhere into the user's PC and bring up the same worklist and I have a problem. Also there was a problem opening a case where the user encountered the "Can't Init ..." error. Then two days later, with no code changes, the error stopped occuring!
Maybe somehow the axd file is not being transmitted fully to the client or gets corrupted in some way?
Intermittent issues are always fun.
From your description it seems it may be due to connection speeds. You may be able to reproduce the issue if you are able to test over a really slow connection. I searched around and found that Fiddler has the capability to simulate modem speeds. You may also want to try extending the timeout of the WARP and WebTab controls. It is by default 20 seconds but it can be configured via JavaScript to your own value. The following Knowledge Base will show you how to change that timeout value:
http://devcenter.infragistics.com/Support/KnowledgeBaseArticle.aspx?ArticleID=10043
All the other potential causes I mentioned should not apply to your situation since the application is one that works consistently. My recommendations were for situations in which the application was new, upgraded, or a recently deployed.
Can you tell me the setting in IIS that you were referring to in you first post?
Is there anything I can do for pages that don't have a WebTab or Warp panel? Thanks for the KB link, this was something that I implemented a while ago for my main "Case" page that contains my WebTab.
I have to admit that I don't know much about those axd files, but is there anyway I can have the page wait for those files before any execution takes place?
Thanks for your responses and all of your help.
This will be for XP or IIS 5.1. It will probably be somethign similar in another OS.
Open IIS -> right click on application and go to Properties -> go to Virtual Directory tab -> Click on Configuration button -> Go to Mappings tab on dialog -> click on .axd from the list and click the edit button -> make sure that the "Check that file exists option" is not checked.
Again, this shouldn't matter as if that was checked your application would not work when using any embedded resources.
For the other pages I can't say for sure. I tried to reproduce using Fiddler but was not sucessful so it may or may not be the issue or it may not be slow enough.
Applied above steps but still showing infragistic java script error.
I am using windows 2003 and iis 6.0.
Pls anybody give me the quick respone.
Thanks in advance.
Many different reasons can cause a Cannot Init Control error. It is usually due to controls not being able to find the JavaScript files necessary to initialize. This can be cause the embedded resources are blocked (which the above method solves), script are not found in the location they are being looked for (move scripts to that location or change where the files are being looked for), or JavaScript is disabled on the browser.
For the second case, it only applies when you are using our CLR 1.x controls or when you have the JavaScriptFileName and/or JavaScriptFileNameCommon properties set for a control. If you are using CLR1.x the JavaScript files would be looked for (by default) in the ig_common virtual directory. In CLR 2.x and up, we started embedding the scripts in the dlls so that these files would no longer be necessary to deploy. On the other hand if the JavaScriptFileName and/or JavaScriptFileNameCommon is set then it would not use the embedded resources and instead would look for those scripts at the path those properties point to. There is also a web.config redirect that will tell the controls to not use embedded resources and instead look for the scripts in the specified folder (Knowledge Base Article above shows how this can be done).
To resolve the last case, it is a matter of enabling JavaScript on the brower.
The simplest way to see what your application is doing is do view the source of the page by doing a "View Source" off the context menu and looking for the axd or the js extensions. If its using axds, I would check browser settings and your IIS settings. If you are using js files then see where it looking for those files and why it is (web.config or property settings). As you can see from the history of this thread, there also seems to be some cases where slow internet speeds can cause a similar issue.
Also, you can create a brand new application with a simple control to see if it is related to that specific application.
I tried to reproduce your issue in various scenarios but it seemed to work ok. I would probably need a small sample with the necessary parts that reproduce to tell you exactly what is going on.
the weather.com script does work ok when the page loads, but has issues on post backs since it is also in the ajax update panel. I removed it for now since it was not a requirement for what I was doing. Maybe as the WebResource.axd file was being created it ran into a problem locating this script and thus didn't complete and inclue the infragistics scripts????
I am assuming that the weather.com script has some sort of error and is leading to ours not being read correctly?
After checked the IIS settings and webconfig. I was at a loss. Then I remembered that a couple days ago I added a script from weather.com that provides a weather widget into my master page. For some reason this javascript was causing the issue. I took it out and things work fine again. This was the script that caused the issue. Strange.
Did you try any of the suggestions in the first response on page 1?
Essentially this error occurs because it cannot find the script files. If you upgraded from CLR 1, then it is most likely because you have the JavaScriptFileName properties set on the controls. The easiest way to check is to look at the rendered markup by doing a view source on the page and finding where the page is trying to load the scripts from. If you see direct links to javascript files, make sure those files are there. If you see webresouce.axd for the script tags then make sure your iis has the setting for the axd extension. You should be able to fine more detail on this in the thread.
If you still have issues, let me know what you have tried and any other information you think is pertinent.