Solved

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

Posted on 2008-10-22
4
1,273 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
Comment Utility
0
 
LVL 32

Author Comment

by:Daniel Wilson
Comment Utility
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
Comment Utility
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
Comment Utility
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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Summernote and form validation 10 36
Run Script only if a div is in the viewport 6 28
Paging GridView 7 32
Phone Dialer 5 33
This article discusses the difference between strict equality operator and equality operator in JavaScript. The Need: Because JavaScript performs an implicit type conversion when performing comparisons, we have to take this into account when wri…
Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
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…

728 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now