VS2005 Designer does NOT display asp:panels!! Why?

R

Rob Dob

The following code works fine when executed, however will not display
correctly within the VS2005 Designer, why is this? is this a bug? it
works fine in VS2003, If I move the ASP:panel to also contain the <TABLE
then everything displays correctly, but my orginal VS2003 code makes use of
panels to include or exclude html based upon there visible property. So Not
having support for this in VS2005 is a real pain.


**** DOES NOT WORK ****
<TABLE id="Table1" cellSpacing="0" cellPadding="1" width=706px
bgColor="#e4e5ef" border="0">
<asp:panel ID="Panel1" runat="server">
<TR>
<TD>
<h1>HEADING1</h1>
</TD>
</TR>
</asp:panel>
</TABLE>


**** DOES DOES WORK ****
<asp:panel ID="Panel1" runat="server">
<TABLE id="Table1" cellSpacing="0" cellPadding="1" width=706px
bgColor="#e4e5ef" border="0">
<TR>
<TD>
<h1>HEADING1</h1>
</TD>
</TR>
</TABLE>
</asp:panel>
 
G

Guest

For what it's worth, you can give your TR an id and runat server. Then you
can set it's visible property as you would the panel. Then you can just get
rid of the panel altogether.

<TABLE id="Table1" cellSpacing="0" cellPadding="1" width=706px
bgColor="#e4e5ef" border="0">
<TR ID="HtmlTableRow1" runat="server">
<TD>
<h1>HEADING1</h1>
</TD>
</TR>
</TABLE>
 
R

Rob Dob

For what it's worth, you can give your TR an id and runat server. Then
you
can set it's visible property as you would the panel. Then you can just
get
rid of the panel altogether.

<TABLE id="Table1" cellSpacing="0" cellPadding="1" width=706px
bgColor="#e4e5ef" border="0">
<TR ID="HtmlTableRow1" runat="server">
<TD>
<h1>HEADING1</h1>
</TD>
</TR>
</TABLE>


thank you ,, I understand that, but am more interested in being able to use
panels, because as this is the way my current program has been setup using
vs2003.

thanks.
 
B

Bruce Barker

a panel renders as a <div> and a div is only legal between <td> or <th> tags
in html markup.

-- bruce (sqlwork.com)
 
R

Rob Dob

a panel renders as a <div> and a div is only legal between <td> or <th>
tags
in html markup.
thank you, is this only since vs2005, as it displays fine within vs2003
design mode
 
M

Marina

It is? I've been using and seen div's all over the place that were not in
<td> or <th> tags. They've all rendered and worked just fine.

div is just a container element, you should be able to use it wherever it
would make sense to have a container.

Lastly, the MSDN documentation on div does not mention any such
restrictions. I would be interested to know where it says that divs are only
valid within td or th tags.
 
C

cpnet

I think what Bruce meant was that within a <table> element, a <div> can only
be used within a <td> or <td> element. If you're not within a table, you
can use <div>'s pretty much anywhere. This is an HTML limitation, not an MS
one.
 
C

Christopher Reed

This is the difference between HTML and XHTML. You could get away with a
lot in HTML (VS 2003), but you have to have well-formed XHTML (VS 2005)
which means that you cannot have a <div> between <table> and <tr>.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,534
Members
45,007
Latest member
obedient dusk

Latest Threads

Top