Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Type is undefined MVC AJAX Script

In one page of my application I get Type is undefined error on the AJAX script.

Why would this be?

Error message:

Type is not defined
MicrosoftMvcAjax.js()()Microsof...vcAjax.js
(line 6)
[Break on this error]
Type.registerNamespace('Sys.Mvc');
Sys.Mv...reate_AjaxOptions=function(){return {};}`

like image 730
zsharp Avatar asked Oct 27 '09 00:10

zsharp


2 Answers

You have to add a reference to MicrosoftAjax.js as well

<script src="../../Scripts/MicrosoftAjax.js" type="text/javascript"></script>
like image 147
Peter Gfader Avatar answered Nov 09 '22 14:11

Peter Gfader


You can start off by installing Firebug for Firefox - it will give you a better error message complete with a call stack.

Sounds like you are trying to instantiate something that is not defined, perhaps you didn't include a javascript file?

like image 25
Igor Zevaka Avatar answered Nov 09 '22 13:11

Igor Zevaka