ScriptSharp and Type.createNamespace

Last post 10-30-2009 1:49 PM by Marcus Vinitius Baffa. 2 replies.

Sort Posts:

  • ScriptSharp and Type.createNamespace

    10-30-2009, 8:43 AM

    Hi,

    I have just downloaded and developed my first Class in Script# (Version 0.5.1.0). The generated javascript includes a Type.createNamespace and Type.createClass. To register the namespace and the class.

    I am using ASP.NET 4.0 Preview 6 and when I run the script in my ASP.NET MVC site it gives me an error generated by the Type.createNamespace line. When I change it to Type.registerNamespace it works OK.

    Looking at the Microsoft Ajax Library I could not find the method Type.createNamespace.

    • Why is Script# generating this kind of statement ????
    • How can I change it so that the javascript is correctly generated with Type.registerNamespace and Type.registerClass ???
    • If this is not possible can I extend the Type Class and include the Type.createNamespace and Type.createClass ???

    Thanks in advance

     

  • Re: ScriptSharp and Type.createNamespace

    10-30-2009, 1:18 PM
    Answer
    • Contributor
      5,653 point Contributor
    • Eilon
    • Member since 06-26-2002, 6:14 PM
    • Redmond, WA
    • Posts 965

    Hi Marcus,

    Script# has two types of projects that it can create:

    1. Projects that use the Script# library (sscorlib)
    2. Projects that use the Microsoft Ajax library (aacorlib)

    The two project types are not compatible with each other. I'm not sure, but support for aacorlib may have been removed from the most recent version of Script#. There's nothing wrong with using either aacorlib or sscorlib - you just have to include the necessary *.js files (sscorlib.js or MicrosoftAjax.js) in your view. I don't know if they can be used on the same page, though.

    For the scripts that come with ASP.NET MVC we chose to use "aacorlib" because we wanted to be compatible with the rest of Microsoft Ajax.

    Thanks,

    Eilon

    Blog: http://weblogs.asp.net/LeftSlipper/
  • Re: ScriptSharp and Type.createNamespace

    10-30-2009, 1:49 PM

    Hi Elion,

    My Class library was created using the Template "Class Library" which uses sscorlib.

    I have just created another Class Library using the Template Atlas Class Library and Script# generated the registerNamespace.

    Thank you very much

Page 1 of 1 (3 items)