Dewald Henning
Dewald Henning

Reputation: 353

'Sys' Undefined error after published to Server

I'm having trouble with my project. I have a master page that 4 other pages use. On the other pages there is a script manager and below that in other div tags, I use the Ajax Accordion control and the Ajax Date Control extender on a textbox. Everything works fine on my localhost but when I publish to our live server (IIS 7, .net framework 4.0) all the ajax controls stop responding and the web page gives the error :

Message: 'Sys' is undefined

Everything is built in the .net framework 4, I have tried other versions of the Ajax Controls, but to no avail. The other posts about this error point to my web config, but have place the proper assemblies inside it, but it still gives me the error. This is the first time I have received the error and I have built multiple web apps like this. Any help would be appreciated. Thanks.

Upvotes: 0

Views: 255

Answers (1)

greg84
greg84

Reputation: 7609

There's obviously a configuration difference between your application locally and the production environment. Are you updating the entire application or just a few files?

A few things to try:

1

Check the web.config file on your production environment to ensure ASP.NET AJAX is enabled. Specifically this section:

  <system.web>
    <httphandlers>
      <remove path="*.asmx" verb="*" />
      <add path="*.asmx" verb="*" validate="false"
           type="System.Web.Script.Services.ScriptHandlerFactory, 
                 System.Web.Extensions, Version=3.5.0.0,
                 Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
    </httphandlers>
  </system.web>

2

If you have any Javascript that tries to access Sys.WebForms.PageRequestManager you need to make sure it's placed after

3

As you're using .NET 4 try setting the AjaxFrameworkMode attribute on the ScriptManager control:

<asp:ScriptManager ID="sm1" AjaxFrameworkMode="Enabled" runat="server">

Some useful links

http://encosia.com/asmx-scriptservice-mistakes-installation-and-configuration/

http://encosia.com/updated-your-webconfig-but-sys-is-still-undefined/

http://www.asp.net/whitepapers/aspnet4#0.2__Toc253429253

Upvotes: 0

Related Questions