By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
431,827 Members | 2,267 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 431,827 IT Pros & Developers. It's quick & easy.

How to set width for a place holder

P: n/a
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
Nov 21 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
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%.

"J-T" <Re**@Reza.Com> wrote in message
news:Os****************@TK2MSFTNGP12.phx.gbl...
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

Nov 21 '05 #2

P: n/a
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>

--
Andrew Robinson
www.binaryocean.com
www.bellinghamdotnet.org
"J-T" <Re**@Reza.Com> wrote in message
news:Os****************@TK2MSFTNGP12.phx.gbl...
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

Nov 21 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.