How to set width for a place holder

Discussion in 'ASP .Net' started by J-T, Nov 21, 2005.

  1. J-T

    J-T Guest

    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-T, Nov 21, 2005
    #1
    1. Advertising

  2. J-T

    J-T Guest

    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" <> wrote in message
    news:Os%...
    >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-T, Nov 21, 2005
    #2
    1. Advertising

  3. 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" <> wrote in message
    news:Os%...
    >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
    >
    >
     
    Andrew Robinson, Nov 21, 2005
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. suzy

    place holder / xslt table

    suzy, Jul 14, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    430
  2. Elizabeth Harmon

    Finding Controls in a Place Holder

    Elizabeth Harmon, Nov 13, 2003, in forum: ASP .Net
    Replies:
    1
    Views:
    403
    George Paiva
    Nov 13, 2003
  3. Karl Seguin

    place holder

    Karl Seguin, Sep 23, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    516
    http://www.visual-basic-data-mining.net/forum
    Sep 23, 2004
  4. JAPHET

    How to align Place Holder

    JAPHET, Sep 23, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    568
    Karl Seguin
    Sep 23, 2004
  5. Rene

    Content Place Holder Width

    Rene, Nov 17, 2006, in forum: ASP .Net
    Replies:
    12
    Views:
    2,316
Loading...

Share This Page