1

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?

2 Answers 2

1

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.

Sign up to request clarification or add additional context in comments.

Comments

0

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.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.