Can I prevent a <asp:Panel> from adding a <div> to the HTML?

  • Thread starter Thread starter Alan Silver
  • Start date Start date
A

Alan Silver

Hello,

I would like to know if it is possible to use a panel, but prevent it
from adding a <div> tag to the HTML. The reason I want to do this is
that I am using a panel to enable me to show/hide part of a page as
required. I would like the part in the panel to appear on the same line
as the controls that precede it, but when the panel is converted to
HTML, a <div> tag is used, and that forces a new line in the browser.

Any ideas? TIA
 
Alan:
Why not just use a placholder which renders nothing and still exposes a
visible property.

Karl
 
Alan:
Why not just use a placholder which renders nothing and still exposes a
visible property.

Erm, 'cos I didn't know there was one!! I got the idea of using a panel
from a book. He didn't mention anything else.

Anyway that works a treat, thanks very much.
 
If you want the panel to appear next to the text, you could position them
using a table.
Put the text in one table cell, and put the panel into the neighboring table
cell.
 
If you want the panel to appear next to the text, you could position them
using a table.
Put the text in one table cell, and put the panel into the neighboring table
cell.

Thanks, but that's a bit over the top for the simple example I was
considering. I can see that it could be useful in other cases, but in
this case a PlaceHolder turned out to be the answer.

Thanks for the reply.
 
Back
Top