Register Namespace & Classes [.AJAX]

Below is the code which will help you create namepsace & a class to group your client side functionalities.

    function pageLoad(sender, eventArgs){
    // Register the namespace
    Type.registerNamespace('Hello');
    // Create the World Class
    Hello.World = function(test1,test2){
        this._test1 = test1;
        this._test2 = test2;
        }
       
    // Set its prototype
    Hello.World.prototype = {
        get_Title: function() {
            return this._test1;
        }
    }
    // Register the class
    Hello.World.registerClass('Hello.World');
    // Create new instance of the class and send the correct parameter
    var test = new Hello.World('haissam','testing');
    // display the value
    alert(test.get_Title());
    }

Best Regards,

Comments

No Comments

The leading UI suite for ASP.NET - Telerik radControls
Outstanding performance. Full ASP.NET AJAX support. Nearly codeless development.