P
Peter Young
If I inherit from a custom base page, it seems that the controls on the base page are unavailable.
e.g.
public class basePage : System.Web.UI.Page
{
protected System.Web.UI.WebControls.HyperLink HyperLink1;
private void Page_Load(object sender, System.EventArgs e)
{
System.Diagnostics.Debug.WriteLine("HyperLink1 is null = " + String.Format("{0}", HyperLink1 == null));
}
...
public class WebForm1 : basePage
{
protected System.Web.UI.WebControls.TextBox TextBox1;
private void Page_Load(object sender, System.EventArgs e)
{
System.Diagnostics.Debug.WriteLine("TextBox1 is null = " + String.Format("{0}", TextBox1 == null));
}
...
This results in the following output:
HyperLink1 is null = True
TextBox1 is null = False
Why is the base page's HyperLink control not available?
e.g.
public class basePage : System.Web.UI.Page
{
protected System.Web.UI.WebControls.HyperLink HyperLink1;
private void Page_Load(object sender, System.EventArgs e)
{
System.Diagnostics.Debug.WriteLine("HyperLink1 is null = " + String.Format("{0}", HyperLink1 == null));
}
...
public class WebForm1 : basePage
{
protected System.Web.UI.WebControls.TextBox TextBox1;
private void Page_Load(object sender, System.EventArgs e)
{
System.Diagnostics.Debug.WriteLine("TextBox1 is null = " + String.Format("{0}", TextBox1 == null));
}
...
This results in the following output:
HyperLink1 is null = True
TextBox1 is null = False
Why is the base page's HyperLink control not available?