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,

Published 31 August 2007 05:03 AM by haissam

Comments

No Comments

This site

Search

Go

This Blog

Syndication

Sponsors

  • MaximumASP
  • Breaking News
  • Find a Job
  • Social Bookmarking
    Tidebuy Reviews
    Online Shopping
    asp.net hosting
    UK online local dating