Why does the following code generate a null reference exception?
public class MyServerControl : WebControl, INamingContainer
{
private TextBox textbox1;
protected override CreateChildControls()
{
if(! Page.IsPostBack)
{
}
}
}
The page reference is not set. I see this sort of example all the time on the web regarding server controls. Why is it that I can not get this to work?