Stuart
Stuart

Reputation: 1151

Script# fails with 'Type' is Undefined

my first attempt at using Script# is not going well. I have an mvc 4 project created from the Internet template and a script# library in my solution.

In the script# library I have a class that looks for an element on the page and a page file that calls this class

I have the scripts deployed to the script folder in the mvc project

To test it I have cleared the About view in the mvc project and added

<div>  
      <canvas id="myCanvas" height=500 width=500></canvas>  
     <script type="text/javascript" src="../../Scripts/Moonbeam.js"></script>
</div>

When i run the program in debug and click the link to the about page I get the message

Microsoft JScript runtime error: 'Type' is undefined

thrown by the fisrt line of the 'compiled' js file

(function(){
Type.registerNamespace('Moonbeam');

clearly I've missed something, anyone care to point it out?

stu

Upvotes: 1

Views: 1096

Answers (1)

gonzarodri
gonzarodri

Reputation: 138

Remember to add the mscorlib.js script in your page (before Moonbeam.js.). It is the #script core javascript.

Upvotes: 1

Related Questions