Solved

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

Posted on 2008-10-22
4
1,277 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

jQuery is a JavaScript library that greatly simplifies JavaScript programming. AJAX is an acronym formed from "Asynchronous JavaScript and XML."  AJAX refers to any communication between client and server, when the human client does not observe a…
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
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…

696 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