Controlling Placeholder Position

  • Thread starter Thread starter John Spiegel
  • Start date Start date
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
 
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.
 
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
 
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
 
Back
Top