Z
zdrakec
Hello all:
Consider the following class definition in JScript, using ASP.NET
AJAX:
Type.registerNamespace('Namespace.Subns.SubSubns.ClassName');
// class definition
Namespace.Subns.SubSubns.ClassName = function(property1, property2)
{
this._property1 = property1;
this._property2 = property2;
}
Namespace.Subns.SubSubns.ClassName.prototype =
{
get_property1: function() {return this._property1;},
get_property2: function() {return this._property2;}
}
Namespace.Subns.SubSubns.ClassName.registerClass('Namespace.Subns.SubSubns.ClassName');
//end class definition
//ClassName2 class definition, which extends ClassName
Namespace.Subns.SubSubns.ClassName2 = function(property1, property2,
property3)
{
Namespace.Subns.SubSubns.ClassName2.initializeBase(this, [property1,
property2]);
this._property3 = property3;
}
Namespace.Subns.SubSubns.ClassName2.prototype =
{
get_property3: function() {return this._property3;},
set_property3: function(property3) {this._property3 = property3;},
get_property1: function()
{
return "BASE CLASS PROPERTY: " +
Namespace.Subns.SubSubns.ClassName2.callBaseMethod(this,
"get_property1");
}
}
Namespace.Subns.SubSubns.ClassName2.registerClass('Namespace.Subns.SubSubns.ClassName2',
Namespace.Subns.SubSubns.ClassName);
This code works just fine EXCEPT when I include the "get_property1"
bit in the ClassName2 prototype definition. Specifically, I get the
"object doesn't support" etc. exception from Microsoft JScript when I
include the callBaseMethod call. If I remove that, it works just fine.
Similarly, if I attempt to use the isInstanceOfType method, or the
inheritsFrom method, I get the same error.
I downloaded and reinstalled the latest ASP.NET AJAX msi, and after a
good bit of digging I am at a loss.
Can someone point me in the right direction?
Best regards,
zdraked
Consider the following class definition in JScript, using ASP.NET
AJAX:
Type.registerNamespace('Namespace.Subns.SubSubns.ClassName');
// class definition
Namespace.Subns.SubSubns.ClassName = function(property1, property2)
{
this._property1 = property1;
this._property2 = property2;
}
Namespace.Subns.SubSubns.ClassName.prototype =
{
get_property1: function() {return this._property1;},
get_property2: function() {return this._property2;}
}
Namespace.Subns.SubSubns.ClassName.registerClass('Namespace.Subns.SubSubns.ClassName');
//end class definition
//ClassName2 class definition, which extends ClassName
Namespace.Subns.SubSubns.ClassName2 = function(property1, property2,
property3)
{
Namespace.Subns.SubSubns.ClassName2.initializeBase(this, [property1,
property2]);
this._property3 = property3;
}
Namespace.Subns.SubSubns.ClassName2.prototype =
{
get_property3: function() {return this._property3;},
set_property3: function(property3) {this._property3 = property3;},
get_property1: function()
{
return "BASE CLASS PROPERTY: " +
Namespace.Subns.SubSubns.ClassName2.callBaseMethod(this,
"get_property1");
}
}
Namespace.Subns.SubSubns.ClassName2.registerClass('Namespace.Subns.SubSubns.ClassName2',
Namespace.Subns.SubSubns.ClassName);
This code works just fine EXCEPT when I include the "get_property1"
bit in the ClassName2 prototype definition. Specifically, I get the
"object doesn't support" etc. exception from Microsoft JScript when I
include the callBaseMethod call. If I remove that, it works just fine.
Similarly, if I attempt to use the isInstanceOfType method, or the
inheritsFrom method, I get the same error.
I downloaded and reinstalled the latest ASP.NET AJAX msi, and after a
good bit of digging I am at a loss.
Can someone point me in the right direction?
Best regards,
zdraked