'sys' is undefined

Problem :-  'sys' is undefined

Solution :-

1. Sys undefined usually indicates that the framework scripts didn't load. In your case, you shouldn't drop the script files directly under the script path: there is versioning involved and the directory structure must be exactly what the script manager expects.
If you look at the html source code in the browser, you'll see what the expected url is for each script. You need to reproduce that directory structure on your server. The directory structure of the library as downloaded from the asp.net site should already be the right one.

2. There are many reasons for getting this error . Few of them i encountered were
1) Web.config not getting updated according to the AJAX enabled website requirement  because most of us are using in existing application and trying to make it work and we miss few entries . Best option is to create an AJAX enabled website and put all the web.config entries into exixting application's web.config or put the exixting aplication web.config entries into newly created website web.config and replace the original one  with new one.
2) If issue is not related to web.config  then its possible that system is not allowing IIS to access the file system where the MicrosoftAjaxLibrary exists usually C: drive. In most of the production environment its not allowed so we need to make use of scriptpath attribute of scriptmanager and it may solve the issue as mentioned in above post where scripts folder is in ur website directory and all the ajaxlibrary java script files are copied into this folder.
3) Even after this it doesnt work then you need to look if the file can be accessible from client machine may be system configuration is not allowing to access it use HTTPWATCH or FIDDLER to see if 404 is coming if so then it has to do with system settings in my case it was ISAPI filter which was causing it and it was URLSCAN security tool which was not allowing it why because of MicrosoftAjaxLibrary contains the folder names which has DOTS(.) like System.Web.Extensions . So we need to modify the .ini file for urlscan security tool ISAPI filter. To do this you need to check if this filter is added in ur IIS if so then you need to go to WINDIR%\System32\Inetsrv\URLscan  and edit th .ini file and make AllowDotInPath=1  this will solve the issue.
 These were my analysis hope it helps . again i reiterate that there is no fix scenario why this errors comes.Different person can get same error for different reasons.

Posted in |


Post a Comment