I've created a base Page class which has some default functionality for adding controls to a div on the page. This page is named BasePage.
public abstract class BasePage : System.Web.UI.Page
{
public String FormId;
public BasePage() : this("EntityForm")
{
}
public BasePage(String formId)
{
this.FormId = formId;
}
protected virtual void Page_LoadComplete(object sender, EventArgs e)
{
this.FindControl(this.FormId); // returns null;
}
}
// Derived class
public partial class _default : BasePage
{
public _default("test")
{
}
protected override void Page_Load(object sender, EventArgs e)
{
//base.Page_Load(sender, e);
}
}
// ASPX code
<asp:Content ID="Content1" ContentPlaceHolderID="cphHead" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="cphCenter" runat="server">
<div id="test" runat="server" class="frmData">
</div>
</asp:Content>
I've got the same functionality working for pages without having a masterpagefile connected to it, it might have something to do with this.. What am i missing here?