"Tim_Mac" <ti********@community.nospamwrote in message
news:Od**************@TK2MSFTNGP04.phx.gbl...
hi tom,
yes i see now that the HtmlControls also have a Visible server side
property.
based on your original post, you had problems with an invisible control
not rendering any HTML. from what you've just written you seem to
understand this already so i'm not sure what the problem was. VS only
complained about the <div runat=serverbecause you had it in between a
TABLE and TR tag.
The problem was that I had 2 errors that it wouldn't build from - I am
trying to find out if there is a setting that will allow me to do it.
1. Could not find any attribute 'Visible' of element 'div'.
2. Per the active schema, the element 'div' cannot be nested within 'table'.
As you saw, there is a Visible attribute - if you also have runat=visible.
As you said, it will not render anything if set to false. So they should
allow it. It is valid.
The other error seems to be fine (at least for IE) so this should be allowed
also. Especially since they render Panel to Div inside of a table for IE.
>
you can of course use Panels inside DataGrids and Repeaters. the problem
was that you had nested the tags in an incorect order. the browser will
still render it and you'll probably get funny gaps in the table, but you
can't expect consistent results with this kind of invalid markup:
<table><div><tr><td>
if you put a Panel inside a DataGrid, you'll get something like this:
<Table id='DataGrid1'><tr><td><table id='Panel1'>... this is Valid markup.
Actually, this is not the case in IE (it is in Mozilla and Firefox,
however).
I have the following code:
<TABLE id="Table1" style="WIDTH: 864px; HEIGHT: 177px" cellSpacing="1"
cellPadding="1"
width="864" border="0">
<asp:panel id="LogonPanel" Runat="server">
<TR>
<TD colSpan="3">
<asp:label id="Label1" runat="server" Height="24px" Font-Bold="True"
Font-Size="Larger">Employee Login</asp:label></TD>
</TR>
....
and the viewsource shows:
<TABLE id="Table1" style="WIDTH: 864px; HEIGHT: 177px" cellSpacing="1"
cellPadding="1"
width="864" border="0">
<div id="LogonPanel">
<TR>
<TD colSpan="3">
<span id="Label1"
style="font-size:Larger;font-weight:bold;height:24px;">Employee
Login</span></TD>
</TR>
My problem is that VS should allow this if you want it - they obviously do
it.
your post included a javascript error on the last line.
you can use server-divs, PlaceHolders, or Panels, all to achieve the same
effect. VS does not have a problem with any. my point about PlaceHolders
was simply that they do not leave a DIV or TABLE tag behind when they
render (Visible). obviously an invisible control will not render any
HTML.
You right I can do all these but they're messages are not correct (Visible
is valid).
The other thing that was driving me crazy was the stupid <TBODYthat kept
showing up and messing up my code. I actually had 2 Panel sections back to
back. When one if visible the other isn't. It kept putting the <TBODY>
inside the first <asp:Paneltag and the closing tag </TBODYinside the 2nd
</asp:Panel>. I kept getting an error saying the <TBODYtags were nested
incorrectly (the problem was they did it). I kept having to delete these to
make my code work. Not sure what was causing it but when I made certain
changes - it kept showing up. Must have done this about 10 times.
Thanks,
Tom
>
tim