How to set width for a place holder

  • Thread starter Thread starter J-T
  • Start date Start date
J

J-T

I am constructing an HTML text which I need to render in my ASP.NET page.
string rssOutput = Posts.listPosts(Constants.WeblogSectionID);

rssOutput contains html code and text.Then I create a literal control as
follow:

LiteralControl lit = new LiteralControl(rssOutput);

lit.Text = lit.Text.Replace("&lt;","<");

lit.Text = lit.Text.Replace("&gt;",">");

lit.Text = lit.Text.Replace("&amp;","&");

and I add that control to a place holder called "phOutput".

this.phOutput.Controls.Add(lit);

I have no problem rendering the HTML inside the place holder and it works
fine,my only problem is I don;t know how to control the width of my place
holder.It seems that I cannot increase it programmatically or at design
time.

Any suggestions?



Thanks
 
I guess I found the problem,

I was rendering a table in my HTML section and its width was set to 10%
instead of 100%.
 
A placeholder does not have width or height. It is simply a way to tag a
location within a page. Try wrapping your litterals inside a table and givce
the cell the required width:

<table><tr><td width=100px>your text</td></tr></table>
 
Back
Top