Geeks With Blogs

News My Blog has been MOVED to https://mfreidge.wordpress.com

Michael Freidgeim's OLD Blog My Blog has been MOVED to https://mfreidge.wordpress.com
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 on Sunday, October 14, 2007 4:25 PM ASP.NET | Back to top


Comments on this post: asp:PlaceHolder can be put within html table, if the table is not runat="server"

# re: asp:PlaceHolder can be put within html table, if the table is not runat="server"
Requesting Gravatar...
great! Thanks for this info - helped me a lot.
Left by Felber on Aug 12, 2009 11:37 AM

# re: asp:PlaceHolder can be put within html table, if the table is not runat="server"
Requesting Gravatar...
This is great info, couldn't find it anywhere else. Thanks!
Left by dev on Sep 04, 2009 10:55 AM

# re: asp:PlaceHolder can be put within html table, if the table is not runat="server"
Requesting Gravatar...
Thanks for this info. Helped me to figure out the error I was getting.
Left by Dnn Coder on Sep 07, 2009 9:55 AM

Your comment:
 (will show your gravatar)


Copyright © Michael Freidgeim | Powered by: GeeksWithBlogs.net