'AjaxControlToolkit' is undefined (javascript)

by Filip Stanek 8. May 2008 16:14

I got this annoying error recently in a website I've been working on.  It worked perfectly fine locally, it worked fine after uploading to the web server on my machine and other machines in the lab (various browsers).  Then, it turns out, it doesn't work on (one of) the client's machines.  Of course, I'm unable to replicate the error locally.

I looked around and it seems the first solution was to clear the cache.  A lot of people said that Ctrl+F5 works, others said they needed to manually clear the cache and then restart the browser.  Well, neither of those worked.

Fortunatelly, the solution turned out to be pretty easy:  Set the "CombineScripts" property of the ToolkitScriptManager to false.

 <ajaxToolkit:ToolkitScriptManager runat="server" ID="ajaxScriptManager" EnablePartialRendering="true" CombineScripts="false" />

Tags: , ,

Web Development

Comments

  • Comments (25)

+0 Vote Up     Vote Down # antointhe United Kingdom on 7/30/2008 10:25:40 AM

antointhe

Yay!!!!

Thanks for that...  I've been scanning to get to the bottom of this everywhere!  some really odd solutions to the problem suggested but it knew it just HAD to be something this simple.

Smile))))

Reply

+0 Vote Up     Vote Down # Flashr Russia on 8/5/2008 6:12:27 PM

Flashr

Yap! You saved my night!

Reply

+0 Vote Up     Vote Down # pascal Canada on 8/26/2008 6:34:47 PM

pascal

Thank you! You just saved me hours of frustration.

Reply

+0 Vote Up     Vote Down # projects1 United States on 9/5/2008 4:34:28 PM

projects1

How do I Set the "CombineScripts" property of the ToolkitScriptManager to false.

<ajaxToolkit:ToolkitScriptManager runat="server" ID="ajaxScriptManager" EnablePartialRendering="true" CombineScripts="false" />

Reply

+0 Vote Up     Vote Down # Filip United States on 9/10/2008 9:36:58 AM

Filip

How do I Set the "CombineScripts" property of the ToolkitScriptManager to false.
      
On the web server, you'll need to locate the ASPX page and open it with some kind of editor like Notepad, Visual Studio, etc.  Search that file for "ToolkitScriptManager" (if you can't find it there, it may be located in other pages, such as a MasterPage). Once you find it, you will need to add the attribute "CombineScripts" and set it to false, just like the blog describes (it should make sense when you see it).  If you still can't figure it out, I would suggest having someone who is more familiar with .NET to make the change.

Reply

+0 Vote Up     Vote Down # sdfs Canada on 12/16/2008 9:07:02 AM

sdfs

sdfsd

Reply

+0 Vote Up     Vote Down # Murray United States on 12/23/2008 2:46:28 PM

Murray

Thanks for that!  I was having this problem with AjaxControlToolkit running under Mono, but not under MS ASP.NET 2.0.  On top of that, it worked with IE6 but not Firefox or IE7.

After setting CombineScripts to false, it now works everywhere.

Reply

+0 Vote Up     Vote Down # Shailesh Saxena India on 1/30/2009 8:14:34 AM

Shailesh Saxena

I have tried but it not solved

Reply

+0 Vote Up     Vote Down # Sreenu Vadluri India on 2/27/2009 2:11:33 AM

Sreenu Vadluri

i have tried but not solved.
i got the same error still now

Reply

+0 Vote Up     Vote Down # TrentMasterson United States on 4/17/2009 9:41:03 PM

TrentMasterson

I had been stumbling around this error for months. The app I was working on was sending a user from a login page that didn't implement AJAX to a home page that did. I was redirecting the user from Login to Home via a Server.Transfer method. After changing it to a Response.Redirect the error went away. I didn't have to remove or add any toolkit attributes. See if this will work for you.

Reply

+0 Vote Up     Vote Down # Filip on 4/25/2009 3:45:58 AM

Filip

Trent,
That's pretty interesting.  I haven't used Server.Transfer() since ASP days, but I guess that was somehow affecting your resource files ( which seems to be what this error is all about ).  Traffic to this particular page on my site has been pretty steady for 10 months now, so I'm guessing that the folks responsible for this error haven't fixed it in the toolkit.  Its neat that you found another cause for this though.  Hopefully that will help some folks out.

Reply

+0 Vote Up     Vote Down # Rawl Spain on 12/22/2009 12:34:07 PM

Rawl

In fact I got that error because of using Server.Transfer, since I was using "Contex.Items" I couldn't use Response.Redirect; but doing the CombineScripts="false" its solved, now I need to know what does that means

Reply

+0 Vote Up     Vote Down # julymoon on 4/29/2009 2:33:00 AM

julymoon

thank you so much , i can also solve with your solution

Reply

+0 Vote Up     Vote Down # Mark United States on 5/9/2009 8:52:29 AM

Mark

Filip,

You are a life saver.  I have had this problem for awhile.  I was searching, in all of the wrong places, and could not find a solution.

Thanks again!

Reply

+0 Vote Up     Vote Down # Eloa Brazil on 5/13/2009 10:40:49 AM

Eloa

Great. Thank you so much!

Reply

+0 Vote Up     Vote Down # Ryan on 5/15/2009 3:34:06 PM

Ryan

Wow thanks for this... I was using a combination of the telerik control and the Ajax toolkit, so my solution ended up being this:
<telerik:RadScriptManager ID="RadScriptManager1" Runat="server" EnablePartialRendering="true" EnableScriptCombine="false" CompositeScript-ScriptMode="Auto" />

I hope this helps someone else!

Reply

+0 Vote Up     Vote Down # Mukesh Sharma India on 7/22/2009 12:25:19 AM

Mukesh Sharma

Gr8, I saved a lot of my time due to this help. Thanks a ton.

Reply

+0 Vote Up     Vote Down # Aditya Mahajan India on 8/10/2009 3:25:35 AM

Aditya Mahajan

I faced the same issue.
It's because the code was built on my development machine in India and deployed on a london server.
The dlls were having india time which was in 'future' of the london time.
Used Touch.exe to update the times of the dll to 'yesterdays' date and the new dlls started working fine on the server when redeployed.

Reply

+0 Vote Up     Vote Down # Thaabiet Salaam South Africa on 9/15/2009 7:26:29 AM

Thaabiet Salaam

I had the issue and setting CombineScripts="false" solved it but I wanted the functionality. Turns out the problem was caused by the absence of the handler that is required when combining scripts.

Reply

+0 Vote Up     Vote Down # Chandan India on 9/19/2009 4:55:02 AM

Chandan

I have tried all the techniqe mentioned above, but still problem is there.
Please help me.

Thanks in advance !

Reply

+0 Vote Up     Vote Down # Lisa Segura United States on 11/14/2009 3:45:34 PM

Lisa Segura

Wow...I have been searching for a solution for this problem on and off for a few days without success.  I could see in the error console that the page was returning 'AjaxControlToolkit' is undefined in IE and AJAXControlToolkit is not defined in Mozilla's Error Console (I'm including both these for future searches).  I used Google to search for a solution until today when I used Bing and your answer was the top solution.  

Thank you!

Reply

+0 Vote Up     Vote Down # waggi United States on 11/18/2009 8:54:32 PM

waggi

Great post.

Reply

+0 Vote Up     Vote Down # waggi United States on 11/18/2009 8:55:20 PM

waggi

Thanks for sharing this information this is really helps us in programming I hope many people will read this article.

Reply

+0 Vote Up     Vote Down # Vishal Patel India on 12/31/2009 6:59:49 AM

Vishal Patel

Hi...

It's greate....It's working fine....i am try from last 1 hr...


Thanks a lot......

Reply

+0 Vote Up     Vote Down # Brandon United States on 1/6/2010 9:03:45 PM

Brandon

Perfect!  Thanks for posting your solution.

Reply

Add comment


(Will show your Gravatar icon)

  Country flag

biuquote
  • Comment
  • Preview
Loading




Tag cloud

About Filip Stanek

Death Note Pic I'm a developer at ACG Multimedia in Cincinnati, OH. Besides working with ASP.NET, Flash, and other web technologies, I enjoy playing chess, video games, etc.

Currently playing:
- Final Fantasy XIII
E-mail me Send mail

Recent Comments

Comment RSS

Month List

Page List