Solved

Addition of ScriptManager causes Javascript errors -- AJAX controls don't work

Posted on 2008-10-22
4
1,275 Views
Last Modified: 2009-04-08
I am modifying an ASPX page and it needs a bit of AJAX to improve the user experience.  I'm trying to add a couple calendar extenders and move a datagrid into an update panel.

But without those components even being added, the presence of the ScriptManager causes IE to show the "Done, but with errors on page" icon.  Double-clicking it shows:
Line: 297
Char: 1
Error: 'Sys' is undefined
Code: 0

If I do include the AJAX controls, they don't work.

I just reverted the page ... verified no error ... added JUST the ScriptManager ... and got the javascript error again.

Any ideas on this?

thanks!
0
Comment
Question by:Daniel Wilson
  • 2
  • 2
4 Comments
 
LVL 10

Expert Comment

by:Bane83
ID: 22778065
0
 
LVL 32

Author Comment

by:Daniel Wilson
ID: 22778105
Yes, I do.  The last website I worked on, using this machine, I added AJAX stuff just fine.
0
 
LVL 10

Accepted Solution

by:
Bane83 earned 500 total points
ID: 22778284
Ah, duh.  Didn't register that you're converting a non-ajax website to ajax.  You'll need to add a few things to the web.config for this to work.

There are two key tags, that must exist on web.config:

 under <assemblies>
<add assembly="Microsoft.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>

under <httpHandlers>
<add verb="GET" path="ScriptResource.axd" type="Microsoft.Web.Handlers.ScriptResourceHandler" validate="false"/>
0
 
LVL 32

Author Comment

by:Daniel Wilson
ID: 22778830
Very, very close.  Don't know why I forgot having to deal w/ that before ...

the block that worked for me was:


      <httpHandlers>
          <remove verb="*" path="*.asmx"/>
          <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>

Thanks for your help!
0

Featured Post

NAS Cloud Backup Strategies

This article explains backup scenarios when using network storage. We review the so-called “3-2-1 strategy” and summarize the methods you can use to send NAS data to the cloud

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Web site error 3 41
jquery datatables, asp.net MVC 9 41
How can I implement a "Select All" with this configuration...? 6 42
Save ms data to server side. 19 46
The task A number given should be formatted for easy reading by separating digits into triads. Format must be made inline via JavaScript, i.e., frameworks / functions are not welcome. So let’s take a number like this “12345678.91¿ and format i…
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

803 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question