I had a table in user control, taht included asp:PlaceHolder. In the code some other user controls are loaded into the placeholder.
<table cellSpacing="0" cellPadding="0" border="0" >
<TR>
<TD >Header</TD>
</TR>
<asp:PlaceHolder id="plc1" Runat="server"></asp:PlaceHolder>
<table>
It worked fine until I decided make the table conditionally invisible based on some server logic. I've added an ID ans runat="server" to the table and got an error:
System.Web.HttpCompileException: error CS1502: The best overloaded method match for 'System.Web.UI.HtmlControls.HtmlTableRowCollection.Add(System.Web.UI.HtmlControls.HtmlTableRow)' has some invalid arguments
To solve the problem I had to wrap table in asp:panel
<asp:panel id="pnl1" runat="server" Visible="false" BorderWidth="0">
<table cellSpacing="0" cellPadding="0" border="0" >
<TR>
<TD >Header</TD>
</TR>
<asp:PlaceHolder id="plc1" Runat="server"></asp:PlaceHolder>
<table>
</asp:panel>
posted @ Sunday, October 14, 2007 4:25 PM