S
skidz
When I create a B object, and testcall in A is called, it does not
execute the OverrideMe() function in B, but instead A. Why, and how
can I get it to do this? I did a debug and "? this" while in the
A.OverrideMe() function, and it said "this" is a B.
public class A
{
protected override string OverrideMe()
{
throw new Exception("A.OverrideMe() must be overridden");
}
public virtual void testcall()
{
OverrideMe();
}
}
public class B : A
{
static B()
{
testcall();
}
protected override string OverrideMe()
{
DoSomethingKewl();
}
}
Just some other info, B is being instantiated via config:
<httpModules>
<add type="B" name="WEB_AUTHENTICATOR"/>
<add name="ScriptModule" type="System.Web.Handlers.ScriptModule,
System.Web.Extensions, Version=3.5.0.0, Culture=neutral,
PublicKeyToken=31BF3856AD364E35"/>
</httpModules>
and the function that is executing the testcall() is really an event.
Any insight would be appreciated.
execute the OverrideMe() function in B, but instead A. Why, and how
can I get it to do this? I did a debug and "? this" while in the
A.OverrideMe() function, and it said "this" is a B.
public class A
{
protected override string OverrideMe()
{
throw new Exception("A.OverrideMe() must be overridden");
}
public virtual void testcall()
{
OverrideMe();
}
}
public class B : A
{
static B()
{
testcall();
}
protected override string OverrideMe()
{
DoSomethingKewl();
}
}
Just some other info, B is being instantiated via config:
<httpModules>
<add type="B" name="WEB_AUTHENTICATOR"/>
<add name="ScriptModule" type="System.Web.Handlers.ScriptModule,
System.Web.Extensions, Version=3.5.0.0, Culture=neutral,
PublicKeyToken=31BF3856AD364E35"/>
</httpModules>
and the function that is executing the testcall() is really an event.
Any insight would be appreciated.