How to set width for a place holder

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
 
J

J-T

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

Andrew Robinson

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>
 

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,769
Messages
2,569,576
Members
45,054
Latest member
LucyCarper

Latest Threads

Top