M
Mike Irwin
I've built a class ControlBase that has a member ReturnResults that looks
like this:
public void ReturnResults(string codeID)
{
Response.Redirect(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.ReturnResults("6");
Now, when this gets called a NullReferenceException 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(string codeID)
{
Response.Redirect(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.ReturnResults("6");
Now, when this gets called a NullReferenceException 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?