I've built a class ControlBase that has a member ReturnResults that looks
like this:
public void ReturnResults(s tring codeID)
{
Response.Redire ct(RESULTS_URL_ PREFIX + codeID);
}
I'm accessing the member like this in a user control that does not inherit
from ControlBase:
ControlBase myControl = new ControlBase();
myControl.Retur nResults("6");
Now, when this gets called a NullReferenceEx ception is thrown. If a user
control does inherit from ControlBase I'm able to call this member with no
problems.
Can someone please explain why this is happening?
like this:
public void ReturnResults(s tring codeID)
{
Response.Redire ct(RESULTS_URL_ PREFIX + codeID);
}
I'm accessing the member like this in a user control that does not inherit
from ControlBase:
ControlBase myControl = new ControlBase();
myControl.Retur nResults("6");
Now, when this gets called a NullReferenceEx ception is thrown. If a user
control does inherit from ControlBase I'm able to call this member with no
problems.
Can someone please explain why this is happening?
Comment