'Sys' is undefined.

Rate It (6)

Last post 07-24-2009 11:40 AM by Thomas Thayil. 201 replies.

Sort Posts:

  • I've tried them all

    01-02-2007, 4:12 AM
    Locked

    Hi,

    I created an ajax web site and when viewing in browser I got the 'Sys is undefined error message', the details pointed to lines 40 & 98 of my source code

     line 40 - Sys.WebForms.PageRequestManager._initialize('ScriptManager1', document.getElementById('form1'));

    line 98 - Sys.Application.initialize();

    I've tried all the above fixes in this thread but have not been able to solve this problem

    Need help!!

     

    Thanks

     

    Tim

  • Re: I've tried them all

    01-02-2007, 4:15 AM
    Locked
    • All-Star
      25,662 point All-Star
    • Luis Abreu
    • Member since 02-12-2005, 6:22 AM
    • Madeira [Portugal]
    • Posts 5,368
    • TrustedFriends-MVPs

    hello.

     

    use fiddler to see what you're getting from the server.

    --
    Regards,
    Luis Abreu
    email: labreu_at_gmail.com
    EN blog:http://msmvps.com/blogs/luisabreu
  • Re: I've tried them all

    01-02-2007, 5:54 PM
    Locked
    • Star
      8,834 point Star
    • MorningZ
    • Member since 07-22-2002, 2:39 PM
    • Fort Lauderdale, FL
    • Posts 1,815

    so i ran into a new scenerio for this error, and it has to do with Vista RTM

    I haven't been able to get debugging working at all until i ran into this blog entry a few hours ago (http://www.thousandtyone.com/blog/CategoryView,category,Vista.aspx), so when i switch into "Classic ASP.NET" app pool, debugging works, but good ol "sys undefined" sticks it's ugly head and renders my MS AJAX stuff useless (and it doesn't matter whether i view the page with or without debugging running).....   going back to the integrated pipeline default IIS7 pool fixes the AJAX but alas, prevents debugging from working...

    "If you make it idiot proof, they'll build a better idiot"
  • Re: I've tried them all

    01-02-2007, 6:13 PM
    Locked
    • All-Star
      25,662 point All-Star
    • Luis Abreu
    • Member since 02-12-2005, 6:22 AM
    • Madeira [Portugal]
    • Posts 5,368
    • TrustedFriends-MVPs
    hello.

    interesting...I'll give it a go tomorrow...
    --
    Regards,
    Luis Abreu
    email: labreu_at_gmail.com
    EN blog:http://msmvps.com/blogs/luisabreu
  • Re: KB912812 may fix it.

    01-22-2007, 12:22 AM
    Locked

    Hope this helps someone. These 3 entries fixed my app. I looked at a ajax enabled web.config and took these entrues and my problem disappeared.

    <httpHandlers>
      <add verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" validate="false"/>
    </httpHandlers>
    
    <httpModules>
       <add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
    </httpModules>
    <assemblies>
      <add assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
    </assemblies>
    I'd also like to note for people changing their IIS configurations, this shouldn't be need on II6 and above as the above entries tell the .NET to add these handlers.
     

    ----------------------------------------
    I'm a programmer because coding is FUN!
    "quoted by Rob Gerwing"
    ----------------------------------------
  • Re: 'Sys' is undefined.

    01-22-2007, 6:51 PM
    Locked
    • Member
      6 point Member
    • abelon
    • Member since 01-22-2007, 11:45 PM
    • Posts 3
    Delete element <system.webServer> from Web.config. It helped for me after trying all suggestions on this site.
  • Re: 'Sys' is undefined.

    01-29-2007, 8:29 PM
    Locked
    • Member
      2 point Member
    • Chap
    • Member since 10-04-2005, 7:30 AM
    • Posts 1
    LSerge:

    I solved the problem!

    Simply create temporary web site from Ajax Control Toolkit Web Site template and copy some sections from web.config to web.config of your web site (<configSections>, so on).

    Copy bin dll file also.

    Hi, LSerge

    Good solution!

    I created a temporary web site from ASP.NET AJAX_Enable Web Site template and copy the web.config file, replace the web.config of my web site, and it worked fine!

    Thanks and sorry for my poor English.

  • Re: I've tried them all

    02-15-2007, 6:09 AM
    Locked
    • Member
      426 point Member
    • rajaron
    • Member since 11-29-2005, 2:27 PM
    • Posts 133

    Add the following tag in web.config file under <configsections> tag

    <sectionGroup name="system.web.extensions" type="System.Web.Configuration.SystemWebExtensionsSectionGroup, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35">
          <sectionGroup name="scripting" type="System.Web.Configuration.ScriptingSectionGroup, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35">
              <section name="scriptResourceHandler" type="System.Web.Configuration.ScriptingScriptResourceHandlerSection, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="false"/>
            <sectionGroup name="webServices" type="System.Web.Configuration.ScriptingWebServicesSectionGroup, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35">
              <section name="jsonSerialization" type="System.Web.Configuration.ScriptingJsonSerializationSection, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="false" />
              <section name="profileService" type="System.Web.Configuration.ScriptingProfileServiceSection, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="false" />
              <section name="authenticationService" type="System.Web.Configuration.ScriptingAuthenticationServiceSection, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="false" />
            </sectionGroup>
          </sectionGroup>
        </sectionGroup> 

     

  • Re: 'Sys' is undefined.

    02-16-2007, 2:13 AM
    Locked
    • Member
      12 point Member
    • ComSpex
    • Member since 03-07-2004, 7:25 AM
    • Posts 6

    I experienced the same problem.

    Now, as far as my case is concerned, the replacement of <system.webServer /> can solve the problem.

    My environment is Windows Vista + (VS2005+SP1).

    BEFORE

       <system.webServer>
        <validation validateIntegratedModeConfiguration="false"/>
        <modules>
          <add name="ScriptModule" preCondition="integratedMode" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
        </modules>
        <handlers>
          <remove name="WebServiceHandlerFactory-ISAPI-2.0"/>
          <add name="ScriptHandlerFactory" verb="*" path="*.asmx" preCondition="integratedMode"
               type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
          <add name="ScriptResource" verb="GET" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
        </handlers>
      </system.webServer>

    AFTER

      <system.webServer>
        <validation validateIntegratedModeConfiguration="false"/>
        <modules>
          <add name="ScriptModule" preCondition="integratedMode" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
        </modules>
        <handlers>
          <remove name="WebServiceHandlerFactory-Integrated"/>
          <add name="ScriptHandlerFactory" verb="*" path="*.asmx" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
          <add name="ScriptHandlerFactoryAppServices" verb="*" path="*_AppService.axd" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
          <add name="ScriptResource" preCondition="integratedMode" verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
        </handlers>
      </system.webServer>

    Hoping this will be adaptive,

     

    ym
  • Re: 'Sys' is undefined.

    03-05-2007, 9:43 AM
    Locked
    • Member
      2 point Member
    • luis_botero
    • Member since 03-05-2007, 2:39 PM
    • Posts 1

    Here's the solution for the main issue: http://dennylove.blogspot.com/2007/01/sys-is-undefined-ajax-10-rc.html

     However, I'm now getting a different problem.

    "Sys.WebForms.PageRequestManagerServerErrorException: An unknown error occurred while processing the request on the server. The status code returned from the server was: 500" If anyone knows what this is I appreciate it.

  • Re: 'Sys' is undefined.

    04-05-2007, 9:01 PM
    Locked
    • Member
      14 point Member
    • finalzero
    • Member since 04-06-2007, 12:48 AM
    • Posts 10

    I have had no success with this problem and I think I am going to ditch the AJAX implementation as its not fit for purpose if these issues carry on.

     I have a clean install of Visual Studio.NET 2005 Professional, with SP1 and IE7 running on a Windows XP Professional machine which is patched up to the hilt.

    I followed the directions on the AJAX site an installed AJAX v1.0 followed by the AJAX Control Toolkit.  Everything seemed find so far, I was able to compile the sample website and upload it to my local IIS web server.  However when actually tried to implement Ajax into my existing project everything started to fall over.

    I received the "sys undefined" message and having tried all the various solutions as listed in this post, decided I would create a AJAX enabled website using the template in VS.  This seemed to work fine and when I created a sample ModalPopupExtendor test on the page it worked as I expected i.e. the page loaded up in IE7 without any issues and the on-click event worked displaying the panel with a button.

    I then created a new AJAX enabled website using the template and begun the process of recreating my project from scratch based on this template - the thinking was that if I used the actual provided template which I have proven works, I would not get any issues and the web.config file would be setup correctly.  This didn't quite work, after having recreated all my pages and code from scratch I tried implementing the Modal Popup control however this time I simply got this message in IE:

    "line 13: object not defined"

    I have tried everything and can't get the damn thing to work.  I am wondering if its to do with the way I have setup the site i.e. I am using a Master Page with several pages that inherit the master page structure.  One of the pages has a html element, which when clicked should display the ajax control i.e. the modal popup dialog - I have exhausted every avenue and I am starting to think the release simply doesn't work or there are some outside issues like recent MS patches that are causing problems.

    Has anyone tested the release with master pages and is there a current bug list page as I am curious as to how many bugs are surfacing now.

     

    Thanks in advance,

    Fz

  • Re: 'Sys' is undefined.

    04-05-2007, 9:22 PM
    Locked
    • Member
      14 point Member
    • finalzero
    • Member since 04-06-2007, 12:48 AM
    • Posts 10

    Decided to do some debugging, published my project to my local iis web server and then used Firefox and Firebug to debug the error.  I found the following when I inspected the sys undefined error:

     

    The first error in Firebug displayed the following message:  this._foregroundElement.parentNode has no properties, when I inspected the error I found this:

    <input type="hidden" name="__EVENTTARGET" id="__EVENTTARGET" value="" />
    <input type="hidden" name="__EVENTARGUMENT" id="__EVENTARGUMENT" value="" />
    <input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE" value="/wEPDwUJMTU2NzQ3NjAyZBgBBR5fX0NvbnRyb2xzUmVxdWlyZVBvc3RCYWNrS2V5X18WBQUeY3RsMDAkQ1BhbmVsQm9keSRJQUNvbmZpZ0xpbmsxBRxjdGwwMCRDUGFuZWxCb2R5JElBTkxpc3RpbmcxBRxjdGwwMCRDUGFuZWxCb2R5JElFTGlzdGluZ3MxBRljdGwwMCRDUGFuZWxCb2R5JElVQWRtaW4xBRljdGwwMCRDUGFuZWxCb2R5JElQV1NpdGUxP/kTs0F0fQ2LyMYDwgwGHBYSAgs=" />

    [HttpException]: Path '/website1/ScriptResource.axd' was not found.
    And more errors:
    Sys.WebForms.PageRequestManager._initialize('ctl00$ScriptManager1', document.getElementById('aspnetForm'));
    ..
    Sys.Application.initialize();
     
     
  • Re: 'Sys' is undefined.

    04-07-2007, 3:54 PM
    Locked
    • Member
      14 point Member
    • finalzero
    • Member since 04-06-2007, 12:48 AM
    • Posts 10

    Managed to fix the problem Big Smile

     Turns out it helps if we RTFM once in a while.  I recommend downloading the excellent AJAX Documentation and spending some time reading through the first few sections.

    There is a nice guide on how to setup an AJAX ready site or integreate AJAX into an existing ASP.NET site properly (has a guide on how to configure the web.config correctly).

    After following this guide and making sure all was well, I then spend the best part of 2 hours searching this forum and others until I found a little gem regarding visibility settings on controls.  I followed the top and used CSS to define the visibility and removed an visibility properties for my controls that were 'ajaxified'.

    And hey presto, it started working, I still got JS errors referring to an object not found but I didn't care as everything worked as intended and I was able to use Master Pages, custom web controls etc correctly.  Seems you have to be careful in how place your controls on the page i.e. taking care to put them in the correct place inside an UpdatePanel decleration.

    So if your getting sys undefined:

    1. Read the documentation

    2. Ensure your web.config is correctly configured as per the guide and this thread

    3. Check your controls i.e. any that you are wrapping in ajax making sure you don't have the visibility set through the form designer (delete the property in the source view and use the CSS file to set the visibility or leave removed as I did).

    The above worked for me where I had a ModalPopupExtender that displayed a web user control (file upload/selection control) when a user clicks on a button.

     

    Hope this helps,

    Fz

  • Re: 'Sys' is not defined

    04-17-2007, 6:20 AM
    Locked
    • Member
      8 point Member
    • Mark Cranness
    • Member since 03-03-2007, 2:25 AM
    • Posts 6

    I really thought I was onto something with my 'Sys is not defined' error message, but instead I have only rediscovered what chrisstead and Denny http://dennylove.blogspot.com/2007/01/sys-is-undefined-ajax-10-rc.html) already found, which was:

    ASP.NET AJAX Script resource handler compresses the scripts it sends with GZIP/DEFLATE and if you already have some HTTP compression going on, it gets double compressed, which is no good and causes 'Sys is not defined' errors.

    Here is my other info:

    - By default, the <scriptresourcehandler enablecompression="true" enablecaching="true"/> line in web.config is commented out.  When commented out, the handler sometimes compresses and sometimes does not.

    When <compilation debug="true">, the handler does not compress and does not compact, regardless of the setting of <scriptresourcehandler enablecompression="...">.

    When <compilation debug="false">, the handler compacts (strips out padding space and shortens variable names?) and *sometimes* compresses.
    It compresses when <scriptresourcehandler enablecompression="true"> (AFAIK).
    If <scriptresourcehandler enablecompression="..."> is not specified (or is commented out), it compresses when the client is Firefox or IE7, but does not compress when the client is IE6 (presumably for safety, as some unpatched versions allegedly cannot handle compression properly - thus people talking about KB912812).

    When <scriptresourcehandler enablecaching="..."/> is not specified (or is commented out), it allows caching of the scripts on the client (regardless of the debug="" setting, unlike WebResource.axd which will not allow caching on the client when debug="true").

    Mark

  • Re: 'Sys' is not defined

    04-19-2007, 12:34 PM
    Locked
    • Member
      2 point Member
    • fax711ab
    • Member since 02-14-2007, 9:06 AM
    • Posts 1

    hi all and pls forgive me this is my first time i write here and for my bad english...here we go:

     i got the same problem working with Visual Web Developer 2005, Asp.net 2.0 ajax 1.0 installed and IE7

    in local network all goes ok

    when i run my ajax enabled page on service provider server i got Sys is undefined

    at the end i  solved my problem in this way:

    - in Visual web developer 2005 i click on solution explorer->Configure Asp.net (it opens an administrative page with protection and other stuffs)

    in that page  i went on protection and i choose ....this application run on Internet and i allowed all users and anonymous to run my page

    it worked well.

    I think we have to set that protection rules (based on our specific application)  before to publish our applications on service providers....it naturally change our web.config so before to do that pls backup your original web.config

    i hope this could help someone!!!

Page 7 of 14 (202 items) « First ... < Previous 5 6 7 8 9 Next > ... Last »