Controlling Placeholder Position

J

John Spiegel

Hi all,

How can you control where a placeholder is positioned on a Web Form? AFAIK,
It doesn't seem to support a style or other positioning (or even sizing)
attributes.

TIA,

John
 
K

Kevin Spencer

A PlaceHolder doesn't render any HTML. Therefore, it doesn't have a
position.

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.
 
S

Stanley

If you want to use a PlaceHolder and position it try adding a litercontrol
to it at run-time and use a span tag around your controls you want to place
in the PlaceHolder.

myPlaceHolder.Controls.Add(New LiteralControl("<span
style=""position:absolute;left:100;top:120;"">"))
myPlaceHolder.Controls.Add(MyNewControl)
myPlaceHolder.Controls.Add(New LiteralControl("</span>"))

-Stanley
 
J

John Spiegel

Thanks, gentlemen. I was reading an example where I think the author had
used a Panel instead.

What would one choose to use a Placeholder for? I see that it allows a
place to predefine a container that you could programmatically add controls
to, for example, but a Panel seems to do that same thing with the added
bonus of being able to position at design time--rather than having to handle
it yourself w/ a span.

Thanks again,

John
 

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,777
Messages
2,569,604
Members
45,227
Latest member
Daniella65

Latest Threads

Top