R
Roger Frei
hello everybody
I have a masterpage and several aspx pages that inerhit controls from the
masterpage. In the Page_Load event of the content aspx page I want to add
some controls. Example code:
protected void Page_Load(object sender, EventArgs e) {
if (!Page.IsPostBack) {
Table table = new Table();
Page.Controls.Add(table);
}
}
But this code adds the control at the end of the masterpage and not add the
end of the content page! How can I add a control at the and of the content
aspx page assuming that it extends a masterpage?
I also tried it with the FindControl(..) method but this is very hard as my
page structure is nested. Additionally, such code wouldn't be very
maintainable --> Control cx = this.FindControl("contentPlaceHolder");
Thank you in advance for your help!
Regards,
Roger
I have a masterpage and several aspx pages that inerhit controls from the
masterpage. In the Page_Load event of the content aspx page I want to add
some controls. Example code:
protected void Page_Load(object sender, EventArgs e) {
if (!Page.IsPostBack) {
Table table = new Table();
Page.Controls.Add(table);
}
}
But this code adds the control at the end of the masterpage and not add the
end of the content page! How can I add a control at the and of the content
aspx page assuming that it extends a masterpage?
I also tried it with the FindControl(..) method but this is very hard as my
page structure is nested. Additionally, such code wouldn't be very
maintainable --> Control cx = this.FindControl("contentPlaceHolder");
Thank you in advance for your help!
Regards,
Roger