Differences between createObject and createManagedObject

I am using the HtmlPage.RegisterCreateableType method to call some C # code from javascript. In the MSDN documentation, they say:

Registers a managed type that can be created from JavaScript code through Content.services.createObject and Helper methods Content.services.createManagedObject

There is no more detailed explanation of these two methods, and I do not know what the differences are. Does anyone know the differences between these methods?

+4
source share
1 answer

Tons of information on both of these methods is here .

CreateObject Description: Given the registered Alias ​​script, this method returns a script for the corresponding managed type.

createManagedObject Description: Given the type Name of the target type of the .NET Framework, this method creates an instance of the default type using either a dimensionless constructor (for reference types) or a default view (for value types).

Basically, you use createObject if you have a script alias for the object. If you just need to create an instance of an object type, you use createManagedObject.

+3
source

All Articles