hi,
i'm having problems with a PlaceHolder. I need to add a control to the
placeholder, but when i run the program it states that the PlaceHolder
control is nothing.
The PlaceHolder's name is HeaderArea. In the code behind I just want
to add a table(bigtable) to the placeholder, like this:
HeaderArea.Controls.Add(bigtable)
This worked fine until i migrated to a different layout with
masterpages... I'm stuck now, so any help is much appreciated.
My default.aspx page (the relevant part):
<%@ Page Title="" Language="VB" MasterPageFile="~/MasterPage.master"
AutoEventWireup="false" CodeFile="Default.aspx.vb" Inherits="_Default"
%>
<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
</asp:Content>
<asp:Content ID="content2" ContentPlaceHolderID="ContentPlaceHolder1"
runat="server">
<asp:Label ID="InitError" runat="server" Visible="false" />
<div id="header">Invoice Archive Viewer <asp:Button
CssClass="button" ID="btnSearch" runat="server" Text="Search" /
><asp:Button CssClass="button" ID="btnHide" runat="server" Text="Hide
Search" /><asp:Button CssClass="button" ID="btnClear" runat="server"
Text="Clear" /><asp:Button CssClass="button" ID="btnMore"
runat="server" Text="More Options" /></div>
<div id="nav">
<asp:Menu ID="Menu1" runat="server" Orientation="Horizontal"
CssClass="menu" StaticEnableDefaultPopOutImage="False">
<Items>
<asp:MenuItem Text="Header" Value="0"></asp:MenuItem>
<asp:MenuItem Text="Lines" Value="1"></asp:MenuItem>
</Items>
<StaticHoverStyle CssClass="statichoverstyle" />
<StaticMenuItemStyle CssClass="staticmenuitemstyle" />
<StaticSelectedStyle CssClass="staticselectedstyle" />
</asp:Menu>
</div>
<div id="search">
<asp:MultiView ID="MultiView1" runat="server" ActiveViewIndex="0">
<asp:View ID="Viewheader" runat="server">
<table width="95%" cellpadding="0" cellspacing="0"
id="innertblheader" align="left">
<tr valign="top">
<td class="TabArea" width="95%">
<div class="scrollable">
<asp:PlaceHolder ID="HeaderArea"
runat="server" Visible="true">
</asp:PlaceHolder>
</div>
</td>
</tr>
</table>
</asp:View>
<asp:View ID="ViewLines" runat="server">
<table width="95%" cellpadding="0" cellspacing="0"
id="innerttbllines" align="left">
<tr valign="top">
<td class="TabArea" width="95%">
<div class="scrollable">
<asp:PlaceHolder ID="LinesArea" runat="server"
Visible="true">
</asp:PlaceHolder>
</div>
</td>
</tr>
</table>
</asp:View>
</asp:MultiView>
</div>