KiranPalode
KiranPalode

Reputation: 498

Asp.Net Ajax script manager

Is it possible to call the methods Type.registerNamespace() and Type.registerClass in java script without using an asp:script manager?

What is the actual use of these function calls in javascript?

Upvotes: 1

Views: 464

Answers (2)

user1767931
user1767931

Reputation: 46

You can't create an object without using an asp script manager like this:

function MyNS.MyClass() { }

But it not works without asp script because of unsupported feature of dot notation. This can be worked in javascript by defining a namespace as below.

var MyNS = MyNS || { };

Using variable is one option to make the name space. So the actual use of this function is to define a name space in java script.

Upvotes: 1

IUnknown
IUnknown

Reputation: 22448

To use these methods you need to add reference on MicrosoftAjax javascript library. By default, ScriptManager control do that for you but you can refer this library manually without ScriptManager from these links:

ASP.NET Web Forms and Ajax 4 or http://www.asp.net/ajaxlibrary/CDNAjax35.ashx

For the Type class reference follow this link: Type Class

In brief, this library allows you to create client-side objects types inheriting them from some existing classes. Usually this library used for extending ASP.NET Web Forms server controls with client-side capabilities.

Upvotes: 0

Related Questions