Asp net aspx page and webcontrol issue
- by Josemalive
Hello,
I have a class that inherits from Page, called APage.
public abstract class APage: Page
{
protected Repeater ExampleRepeater;
....
protected override void OnLoad(EventArgs e)
{
if (null != ExampleRepeater)
{
ExampleRepeater.DataSource = GetData();
ExampleRepeater.DataBind();
}
base.OnLoad(e);
}
}
For other hand i have an aspx page called Default that inherits from this APage:
public partial class Default : APage
{
}
on the design part of this Default page, i have a repeater:
<asp:Repeater ID="ExampleRepeater" runat="server">
<ItemTemplate>
<%# DataBinder.Eval(Container.DataItem, "Name") %><br/>
</ItemTemplate>
</asp:Repeater>
This repeater is datasourced at the base APage load event, but at this level this web control is null.
Do you have any idea why the control is null in the base page?
Thanks in advance.
Best Regards.
Jose.