L
luminousc
Hi guys,
I'm still a relative newbie at oop, as my background has been in old
fashioned vanilla ASP, so please try to make your responses as simple
as possible.
I'm having issues with inheritence in my c#.net app. I've built a basic
web control with some members and properties. I'm now trying to create
a more specific class that uses all the base properties and then adds
some more for a specific purpose. I can't seem to find the right syntax
to get this to work.
simplified Example:
public System.Web.UI.WebControls.Table wizardBaseTable;
public class BaseWizard : System.Web.UI.UserControl
{
public Hashtable WizardEventLog = new Hashtable();
}
and:
public class wizard_Request : DTS_UI.Components.Wizards.BaseWizard
{
WizardEventLog.Add(DateTime.Now.ToLongTimeString() + " Wizard
Initialised","<status at init here>");
string aString = wizardBaseTable.ID.ToString();
}
Basically, the WizardEventLog.Add() line executes fine and I can see
the entry added successfully, but when it get's to referencing the
wizardBaseTable, the app crashes with a null reference error even
though the Table is initialised ok in the markup file of the base
control version.
I'm guessing that maybe I have to use something like the LoadControl()
method when defining the inheritence but I can't find anything that I
understand on Google / GoogleGroups
Thanks
C Poole
I'm still a relative newbie at oop, as my background has been in old
fashioned vanilla ASP, so please try to make your responses as simple
as possible.
I'm having issues with inheritence in my c#.net app. I've built a basic
web control with some members and properties. I'm now trying to create
a more specific class that uses all the base properties and then adds
some more for a specific purpose. I can't seem to find the right syntax
to get this to work.
simplified Example:
public System.Web.UI.WebControls.Table wizardBaseTable;
public class BaseWizard : System.Web.UI.UserControl
{
public Hashtable WizardEventLog = new Hashtable();
}
and:
public class wizard_Request : DTS_UI.Components.Wizards.BaseWizard
{
WizardEventLog.Add(DateTime.Now.ToLongTimeString() + " Wizard
Initialised","<status at init here>");
string aString = wizardBaseTable.ID.ToString();
}
Basically, the WizardEventLog.Add() line executes fine and I can see
the entry added successfully, but when it get's to referencing the
wizardBaseTable, the app crashes with a null reference error even
though the Table is initialised ok in the markup file of the base
control version.
I'm guessing that maybe I have to use something like the LoadControl()
method when defining the inheritence but I can't find anything that I
understand on Google / GoogleGroups
Thanks
C Poole