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

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
 
K

Karl Seguin

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

Karl
 
A

Alan Silver

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.
 
S

Steve C. Orr [MVP, MCSD]

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.
 
A

Alan Silver

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.
 

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
474,434
Messages
2,571,689
Members
48,796
Latest member
Greg L.

Latest Threads

Top