'AjaxControlToolkit' is undefined (javascript)

by filip 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 (47) -

antointhe
antointhe United Kingdom
7/30/2008 10:25:40 AM #

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

Flashr
Flashr Russia
8/5/2008 6:12:27 PM #

Yap! You saved my night!

Reply

pascal
pascal Canada
8/26/2008 6:34:47 PM #

Thank you! You just saved me hours of frustration.

Reply

projects1
projects1 United States
9/5/2008 4:34:28 PM #

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

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

Reply

Filip
Filip United States
9/10/2008 9:36:58 AM #

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

sdfs
sdfs Canada
12/16/2008 9:07:02 AM #

sdfsd

Reply

Murray
Murray United States
12/23/2008 2:46:28 PM #

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

Shailesh Saxena
Shailesh Saxena India
1/30/2009 8:14:34 AM #

I have tried but it not solved

Reply

Sreenu Vadluri
Sreenu Vadluri India
2/27/2009 2:11:33 AM #

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

Reply

TrentMasterson
TrentMasterson United States
4/17/2009 9:41:03 PM #

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

Filip
Filip
4/25/2009 3:45:58 AM #

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

Rawl
Rawl Spain
12/22/2009 12:34:07 PM #

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

julymoon
julymoon
4/29/2009 2:33:00 AM #

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

Reply

Mark
Mark United States
5/9/2009 8:52:29 AM #

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

Eloa
Eloa Brazil
5/13/2009 10:40:49 AM #

Great. Thank you so much!

Reply

Ryan
Ryan
5/15/2009 3:34:06 PM #

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

Mukesh Sharma
Mukesh Sharma India
7/22/2009 12:25:19 AM #

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

Reply

Aditya Mahajan
Aditya Mahajan India
8/10/2009 3:25:35 AM #

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

Thaabiet Salaam
Thaabiet Salaam South Africa
9/15/2009 7:26:29 AM #

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

Chandan
Chandan India
9/19/2009 4:55:02 AM #

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

Thanks in advance !

Reply

Lisa Segura
Lisa Segura United States
11/14/2009 3:45:34 PM #

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

waggi
waggi United States
11/18/2009 8:54:32 PM #

Great post.

Reply

waggi
waggi United States
11/18/2009 8:55:20 PM #

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

Reply

Vishal Patel
Vishal Patel India
12/31/2009 6:59:49 AM #

Hi...

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


Thanks a lot......

Reply

Brandon
Brandon United States
1/6/2010 9:03:45 PM #

Perfect!  Thanks for posting your solution.

Reply

Jim Ierley
Jim Ierley United States
3/12/2010 11:32:10 AM #

Thanks for posting.  In my case, this error was happening as a result of my page having an output cache.  Setting CombineScripts to false would eliminate the problem, however I wanted a fix that would allow for the default value of true as well.   I was able to do this disabling the cache in the page load event of the offending user control that contained my AjaxControlToolkit control:

Response.Cache.SetCacheability(HttpCacheability.NoCache);

This allowed for the ToolkitScriptManager to have the following:

<ajaxToolkit:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server" CombineScripts="true" ScriptMode="Release"></ajaxToolkit:ToolkitScriptManager>

Reply

dennis
dennis Hong Kong S.A.R.
4/13/2010 10:16:09 PM #

<ajaxToolkit:ToolkitScriptManager  runat="server"  ID="ajaxScriptManager"  EnablePartialRendering="true" CombineScripts="false" />
well, if i set combinescripts is false, the problem is fixed.
however if i set to ture, the probem still happened.
please help me
<ajaxToolkit:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server" CombineScripts="true" ScriptMode="Release"></ajaxToolkit:ToolkitScriptManager>


protected void Page_Load(object sender, EventArgs e)
{
Response.Cache.SetCacheability(HttpCacheability.NoCache);
}

Reply

Jean Mallet
Jean Mallet Brazil
5/5/2010 2:32:22 PM #

Thats it! Thank U!

Reply

Jack
Jack Czech Republic
5/15/2010 2:58:59 PM #

Yes, finnaly on your page I find a solution. I was looking for reason everywhere.
Thank you!

Reply

Rick JAckson
Rick JAckson India
5/29/2010 4:11:56 AM #

Hello,

I Tried using that but its not working Frown i am using validator callout in my usercontrol and i am trying to find that vallidatorcallout from my page;

  AjaxControlToolkit.ValidatorCalloutBehavior._currentCallout = $find('<%= ucZasSearchPanel1.VCalloutZonesClientID %>');

I am getting the validatorcalloutId but i am getting AjaxControlToolkit is undefined any workaround for this ?

Thanks

Reply

Bryan Pearce
Bryan Pearce United States
7/6/2010 11:59:28 AM #

I'm so frusterated.  None of these posts works for me.  I'm using Visual Studio 2010, .net 4.  I need to set the SelectedColor property of my ColorPickerExtender control which resides in a user control, which is in a child page of the master page.  

In the master page, I have:
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
and
            <asp:ToolkitScriptManager runat="server" ID="ajaxScriptManager" EnablePartialRendering="true" CombineScripts="true" ScriptMode="Release"/>

            <script type="text/javascript">
                Sys.Application.add_init(function() {
                if (!AjaxControlToolkit.ColorPickerBehavior._colorRegex) {
                    AjaxControlToolkit.ColorPickerBehavior._colorRegex = new RegExp('^[A-Fa-f0-9]{6}$');
                    }
                });
            </script>

in the Master page's page load event, I have:
            Response.Cache.SetCacheability(HttpCacheability.NoCache);

I still get the error "Microsoft JScript runtime error: 'AjaxControlToolkit' is undefined".

Reply

Bryan Pearce
Bryan Pearce United States
7/6/2010 12:02:06 PM #

Oh, and I've tried about every permutation I can think of, and I still get the error.  Please help!

Reply

Preeti singh
Preeti singh India
7/9/2010 6:58:55 AM #

Boss you rock....Clearing the cache solved my problem...........

Regards,
Preeti Singh

Reply

Narendra
Narendra India
7/20/2010 3:56:43 AM #

Thanks! Its a great help Smile

Reply

Olivia Henien
Olivia Henien United States
9/23/2010 1:50:37 PM #

THANK YOU I WISH I READ THIS POST 2 DAYS AGO !!!!

Reply

brian
brian Netherlands
10/19/2010 7:18:35 AM #

This is not the correct answer, as the point of CombineScripts is to combine scripts.

In order to use the script manager you must inlude an IHttpHandler:
  <ajaxToolkit:ToolkitScriptManager ID="tsm" runat="server" CombineScriptsHandlerUrl="/CombineScriptsHandler.ashx" CombineScripts="true"></ajaxToolkit:ToolkitScriptManager>
  
This will add the necessary scripts and make a single script form them.
see: weblogs.asp.net/.../...ntrols-while-debugging.aspx

Reply

Jack
Jack Korea
11/15/2010 11:49:30 PM #

Thank you!!  

Reply

st
st India
3/29/2011 4:21:45 AM #

Perfect !! Resolved my Issue .. Thanks !

Reply

Pippo
Pippo Italy
4/5/2011 3:23:15 PM #

I LOVE YOU!!!!!!

Reply

Vishal
Vishal India
5/9/2011 9:13:25 AM #

Thanks ...... Its a great solution Smile

Reply

Shiv
Shiv United States
8/1/2011 2:56:29 PM #

Thanks a ton.. it solved my problem.. Smile

Reply

MorbidKoder
MorbidKoder United States
8/25/2011 10:18:15 AM #

What bugs me.. Is I want the performance benefits of using CombineScripts="true". Sadly though. I must disable it because it seems to cause issues.

Reply

Jos&#233; Juan
José Juan Spain
9/12/2011 3:42:14 PM #

Thank you very much you were my salvation. Working under "Mono" My solution was <ajaxToolkit:ToolkitScriptManager ID="ToolkitScriptManager1" ScriptMode="Release" CombineScripts="true" runat="server" EnablePartialRendering="true"> </ ajaxToolkit: ToolkitScriptManager>

I hope someone serve you, thanks

Reply

MohammedZaki
MohammedZaki India
10/14/2011 6:36:04 AM #

Great. Its worked !!! Thank you so much !!

Reply

Jack
Jack Australia
10/20/2011 2:18:40 AM #

I think <ajaxToolkit:ToolkitScriptManager  runat="server"  ID="ajaxScriptManager"  EnablePartialRendering="true" CombineScripts="false" />
well, if i set combinescripts is false, the problem is fixed.
however if i set to ture, the probem still happened.
please help me
<ajaxToolkit:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server" CombineScripts="true" ScriptMode="Release"></ajaxToolkit:ToolkitScriptManager>


protected void Page_Load(object sender, EventArgs e)
{
Response.Cache.SetCacheability(HttpCacheability.NoCache);
}

may work?

http://www.harveynormansecurity.com.au/

Reply

Abeiku
Abeiku United States
10/20/2011 6:29:14 AM #

Hi,
my ajax toolkit client side gives this error  "ASP.NET Ajax client-side framework failed to load"  as well as "Sysy undefined" on firefox but works fine on IE.. i have included all the web.config requirements but stil no headway with firefox.
am runing the web application on apache mono ubuntu server.

I have been strugling with this for weeks now.. some one help me please. Thanks

Reply

Allan
Allan United States
11/3/2011 1:27:55 AM #

Thanks for sharing this information this is really helps us in programming I hope many people will read this article....
<a rel="dofollow" href="http://www.howtophotoshoptuts.com/">How to Photoshop</a>

Reply

Add comment




  Country flag
biuquote
  • Comment
  • Preview
Loading


About Filip Stanek

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

Currently playing:
- StarCraft IIE-mail me Send mail

RecentComments

Comment RSS

Month List