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?
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.
Thanks Kim for your fast response.I have checked All Above cases.Here issue is in my production box.Recently we installed share point.before that it's working fine.My prod box contains Windows 2003 server,IIS 6.0,Netadvantage 2006 volume 2,Framework 2.0.In my web application i am using ultraweb menu, webtree and webdatechoseer.I am getting "Object Expected" Javascript error and i am unable to view infragistic images also when i looked the properties it's showing image type as unknown with webresource.axd extension. I have checked .axd mapping extension in IIS, ig_common also pointing to the correct path.ASP.Net sample browser also throwing object expected error in prod box.I have installed and re-installed several times netadvantage 2006 and re-installed iis also but still same issue.
Try using the following Knowledge Base article to redirect the scripts and images through the web.config:
This will force the controls to use the actual js and image files instead of the embedded resources. Also, you may have to set some of the image properties for it to redirect thsoe properly. For the scripts no other steps are necessary but this KB article.
It is entirely possible that the older versions of our controls may be having issues in that environment. Try a sample app with 8.2 to see if you get the same results.