Error: "Sys" is Undefined error

Please visit my new blog at budigelli.com and see the same Error: “Sys is Undefined error” post.

I was playing with AJAX enabled applications for some time but not really done any thing major yet. I was working on a small project that required me to add some AJAX functionality using simple updatepanels. I dropped the necessary controls like scriptmanager and updatepanel in to the page and added the references to System.Web.Extensions.

I ran the application and ran in the error message mentioned above.

Error: “Sys” is Undefined Error

I read some blogs and added another reference to “System.Web.Extensions.Design” and added some

<handler> tags to the web.config file.

Nothing seemed to work and I still had the issue.

I got smart at this time and created a new AJAX enabled web site in Visual Studio and copied the web.config file over to my existing application.

The error message is gone!!!

About these ads

27 Comments »

  1. I’m having this same problem, but am having a hard time getting specific causes. Most of the articles I’ve found when Googling the error message have been referring to Beta versions of the ASP.NET Ajax Extensions. If you can offer some details on how I can fix this problem, please email me.

  2. Machine Programs said

    On Windows Vista, IIS 7, I right-clicked on the virtual directory and then clicked on “Convert to Application.” The “Sys is undefined” error is now gone and my AJAX pages work.

  3. Tanner said

    I started a new page using an ajax accordion and finished developing it fine. It worked local and remotely with full functionality.

    I made a backup image of this whole server down to the bare metal, and did a build from that image. IIS rebuilt itself fine and the rest of my site works, except for this ajax accordion. I get a sys is undefined error when I go to load the page. It still binds my controls within the panes of the accordion, because it displays the first one as default and it has data.

    I’ve looked through tons of these articles related to this, but I haven’t found one yet that will explain why it wont work in my case. I started from a ajax template project and integrated my whole site back into that template.

    I just dont get why it works on one 2003 server w/ sp1 and not on another identical 2003 server w/ sp1.

  4. Adrian said

    To get rid of this weird problem follow the following
    steps

    1)open IIS and right click on your web site virtual directory and then click
    properties

    2)then on virtual directory tab click on configuration button

    3)In mappings tab ,make configuration like this.

    Executable:
    “C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\aspnet_isapi.dll”
    .locate this dll file

    Extension: .axd

    Verbs: All Verbs

    Script Engine: checked

    Check that file exists: do not check this .

    finally click OK.

  5. Neem said

    Thanks a lot Adrian.
    I was getting ‘Sys is undefined’ error because of your’s given solution, error was resolved.

  6. Igor said

    >>
    I got smart at this time and created a new AJAX enabled web site in Visual Studio and copied the web.config file over to my existing application.
    >>

    Thanks!
    :)

  7. dhina said

    i had the same problem, and solved it by the method u had suggested.
    Thank you very much!

  8. allan said

    no such luck from any of these supposed resolutions. I did the IIS (running XP SP3), it is an application, I started with a VS2005 AJAX Enabled Web Site, added the code from this site: http://encosia.com/2007/01/16/css-style-as-ajax-progress-indicator/ to do a simple progress indicator, i’ve reinstalled asp.net from thre regiis.exe, I’ve verified all the files exist in the right directory, nothing. I’ve even tried pasting the Script in between the Head tags, outside the HTML (that doesn’t do anything), in the body, blah blah blah.

    Nothing but that *expletive* Sys undefined error remains and the progress bar doesn’t work.

    I’ve never had this problem before with any other application, just this progress bar thing.

  9. budigelli said

    The quickest solution (And it works) i suggest was to create a new Project and copy over the Web.Config file (you could use either Windiff or WinMerge) to compare the new web.config and your existing web.config (if you have to port any modifications).

    Hope it helps.
    Budigelli

  10. Sujoy Dutta said

    I am facing the same problems on two of my dev boxes however there is another dev box on which the same code works perfectly fine.

    I applied both the above given solutions but it still it doesn’t work.

  11. budigelli said

    Hi Sujoy, i have not tested any of the tested suggestions (i don’t have that problem any more). I still think, the best and quickest way to fix this issue is to create a new AJAX enabled application and merge that web.config file with you web.config.

    If that didn’t work (Or the same web.config only works on some machines), you might want to re-install AJAX.NET.

    Also, i started using JQuey for all my presentaion (UI effects) and Communication (AJAX Calls) needs and i am very happy with it so far. You might want to check it out http://jquery.com/

    – Thanks

  12. Jeff said

    Adrian-

    I had that verb defined, but the Check if File Exists box was checked. Once I unchecked that, the problem was fixed. Thanks!

  13. removing old project web config and copy from new project, these are only tricks which works sometimes only.

    I got something which is very good and I even tried and follow the steps it works for me. thanks

    http://scandoko.blogspot.com/2007/10/sys-is-undefined-aspnet-ajax.html

  14. Manj said

    Adrian, your suggestion is wonderful, it worked for me. I did everything with web.config but mapping the extention for .axd in IIS solved the problem finally

  15. Varin said

    Adrian’s suggestion solved my problem. I was missing several extension mappings on IIS. Thanks Adrian.

  16. rem said

    nice post.

  17. Angelo said

    Fix:

    On the top of ASPX page type:

    (this will automatically be added once you drag and drop the “UpdatePanel”.)
    drag and drop “ScriptManager” below the tag and make sure above other ajax controls and the respective javascript.

    Now, in the web.config add between tags:

    (Usually the problem occurs here in the httpHandlers, as many use “Microsoft” instead of “System”.

    ~Cheers.

    Angelo

  18. Angelo said

    Fix:

    On the top of ASPX page add register:(sorry couldn’t add the less than and greater than symbol as the post is not accepting it so typing [ ] symbols instead.)

    [%@ Register Assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
    Namespace="System.Web.UI" TagPrefix="asp" %]

    (this will automatically be added once you drag and drop the “UpdatePanel”.)
    drag and drop “ScriptManager” below the “form” tag and make sure above other ajax controls and the respective javascript.

    Now, in the web.config add between [system.web] tags:

    [httpHandlers]
    [add verb="GET" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler" validate="false"/ ]
    [ /httpHandlers]

    (Usually the problem occurs here in the httpHandlers, as many use “Microsoft” instead of “System”.

    ~Cheers.

    Angelo

    • Samir said

      Thanks Angelo. Your solution worked for me.

  19. CMS said

    I was able to resolve it this way:
    AJAX, .NET 2.0 ‘Sys’ is undefined and RewritePath

    http://www.aspnetportal.org/Content.aspx?ContentId=613

  20. Nitesh Shah said

    A customer was facing the similar problem and the cause was the web.config file was in the sub-directory in which he had the asp.net application and the directory was not a web application. Converting it into a virtual directory resolved the problem as the application was now referencing the web.config placed in the directory and not trying to find a web.config file in the parent directory of the website which did not exist at all. Hope it is useful for all.

  21. Vitthal said

    I am using IE 8, .Net Framework 2.0 , Ajax , VSTS 2008 for my project.
    I have created one custom handler as,

    i have created “OutOfBandSessionValidator.vb” too as

    Imports System.Web
    Imports System.Web.SessionState
    Namespace CustomHandler
    Public Class OutOfBandSessionValidator
    Implements IHttpHandler
    Implements IRequiresSessionState
    Public ReadOnly Property IsReusable() As Boolean Implements IHttpHandler.IsReusable
    Get
    Return False
    End Get
    End Property

    Public Sub ProcessRequest(ByVal context As HttpContext) Implements IHttpHandler.ProcessRequest

    End Sub
    End Class
    End Namespace

    i have also installed “ASPNETAJAXVS2008″ but it still shows me the error
    “sys” is undefined.
    i tried all above ways to solve the problem but the issue still persists.
    Please help me.

    I stuck here since last one week.
    Help will be greatly appreciated.
    Thanks in advance.

  22. vitthal said

    I am using IE 8, .Net Framework 2.0 , ASP.NET2.0 Ajax1.0,XP2 for my project.
    I have created one custom handler as-

    I have done all above ways to solve the issue but it still shows me error ‘Sys’
    is undefined in my javascript file

    _EventPool = function() {
    _EventPool.initializeBase(this);
    };
    _EventPool.prototype = {
    addEvent: function(name, handler) {
    this.get_events().addHandler(name, handler);
    },
    removeEvent: function(name, handler) {
    this.get_events().removeHandler(name, handler);
    },
    raiseEvent: function(name, source, args) {
    var handler = this.get_events().getHandler(name);
    if (handler) {
    handler(source, args);
    }
    }
    };
    _EventPool.registerClass(“_EventPool”, Sys.Component);
    var $evp = $create(_EventPool, { “id”: “EventPool” }, null, null, null);

    so what should i do to avoid this problem please help me.

  23. kevtech said

    just copy the .dll in your bin folder the dll is system.web.extensions.* and after adding the correct reference it works

  24. Dinakar said

    hi.. i am a system administrator & doing a part time coding project. i had this problem from a week. The 3 things i did to get this error to go away while using .net 2.0 are:-

    1. There needs to be script manager fo Ajax to work. put it in the site master if you have one, or else put it in the page.

    2. Put these Httphandlers in the web.config file under section

    3. Add the Controls under the section

    4. IIS does not understand .axd by default. Add an application Extensions IIS mapping for .axd & executable path as “C:\WINNT\Microsoft.NET\Framework\v2.0.50727\aspnet_isapi.dll”. There is a check box for “Verify that file exists”. if the app still fails with this checkbox checked, try unchecking it.

  25. kavitha said

    I got smart at this time and created a new AJAX enabled web site in Visual Studio and copied the web.config file over to my existing application.
    Thanks for the solution.

  26. Anil Kumar Pillai said

    Hi,

    I was playing with ASP.NET Progress Bar control on my aspx page and I was getting an error ‘Sys’ is undefined. I tried adding the

    at the top of my aspx page, but not use. It was still getting the same error.

    Finally I entered the following into the Web.config file of my web application and boom, it started working.

    Thanks and Regards
    Anil

RSS feed for comments on this post · TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

%d bloggers like this: