.NET Panel vs. Placeholder controls

G

Guest

Hello All:

Does anyone know the difference between the Panel and Placeholder controls?
What really are the differences? Why would I use one and not the other?

TIA,
 
T

ThunderMusic

Hi,
I'm not an expert, but I think the panel generates a div or a span depending
on the browser it encounters... the placeholder is mostly (if not
exclusively) used in masterpages so it indicates to inheriting pages that
there should be something in this place...

See there for more details
http://msdn2.microsoft.com/en-us/library/wtxbf3hh.aspx

I hope it helps

ThunderMusic
 
E

Eliyahu Goldin

Joe,

The Panel is essentially an html <div> element, it is a container where
other controls can be placed.

The Placeholder is not a container in the same sense. It doesn't produce any
html output. It just reserves place for the controls you put in it and gets
replaced by them.


--
Eliyahu Goldin,
Software Developer & Consultant
Microsoft MVP [ASP.NET]
http://msmvps.com/blogs/egoldin
http://usableasp.net
 
G

Guest

Hi,

Thanks for your reply. I just trired each in a web form and found that the
OPanel does render as a <div> (at elast in my browser IE 6). Does a
placeholder render as anything? It doesn't appear to be that way.

Thanks,
 
G

Guest

Hi Joe,

Panel is more advanced control and renders as <div> tag (therefore can have
background colour, background image, tooltip etc.) whilst place holder does
not render any html mark-up itself (inner controls only). As name indicates,
Placeholder is usually used as container for dynamically created controls
that have to be instantiated within a parent control, or to show / hide child
controls.

Regards
 
G

Guest

Thanks to everyone.
--
Joe


Milosz Skalecki said:
Hi Joe,

Panel is more advanced control and renders as <div> tag (therefore can have
background colour, background image, tooltip etc.) whilst place holder does
not render any html mark-up itself (inner controls only). As name indicates,
Placeholder is usually used as container for dynamically created controls
that have to be instantiated within a parent control, or to show / hide child
controls.

Regards
 
D

David

Panel does NOT always show as a DIV. It depends on your browser and your
browsercaps.

I had problems with worldpay. I was blaming them for changing my 'divs' to
tables. I really didn't understand at the time what was happening when I was
doing exactly what they did with the page (screen scraping).

It turns out that they use a java scraper. The browsercaps had never heard
of the browser type, so .NET was rendering it as a table, which was totally
screwing up the formatting.

If people don't have the latest browsers or are using some sort of home
built screenscraping (not using the MSXMLHTTP stuff), then .NET renders to
the lower common denominator, which is tables.

So, if you want to ensure divs, then render your own as an HTML control.

--
Best regards,
Dave Colliver.
http://www.AshfieldFOCUS.com
~~
http://www.FOCUSPortals.com - Local franchises available
 

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

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,904
Latest member
HealthyVisionsCBDPrice

Latest Threads

Top