Writing text to a specific area in a control

Discussion in 'ASP .Net Web Controls' started by Grant Mills, Jan 14, 2004.

  1. Grant Mills

    Grant Mills Guest

    I want to print out text to a specific area of a control, using code-behind.
    and have it display in the correct format, as well it has to display all
    html tags correctly.

    I've tried using a ASP:label, but that doesn't do text formatting correctly
    (no linefeeds)
    a TextArea displays the text correctly, but <img> tags just print out.

    Is there a way to have a <p id="X"> and with code behind, do a X.innerhtml =
    , or X.Innertext =

    ?




    -Grant Mills
    Grant Mills, Jan 14, 2004
    #1
    1. Advertising

  2. hi Grant,
    <p id="p1" runat="server"></p>

    declare p1 as an HtmlControls.HtmlGenericControl in your code behind and
    access its properties.
    "Grant Mills" <> wrote in message
    news:W3jNb.15503$n44.135@clgrps13...
    > I want to print out text to a specific area of a control, using

    code-behind.
    > and have it display in the correct format, as well it has to display all
    > html tags correctly.
    >
    > I've tried using a ASP:label, but that doesn't do text formatting

    correctly
    > (no linefeeds)
    > a TextArea displays the text correctly, but <img> tags just print out.
    >
    > Is there a way to have a <p id="X"> and with code behind, do a X.innerhtml

    =
    > , or X.Innertext =
    >
    > ?
    >
    >
    >
    >
    > -Grant Mills
    >
    >
    Alessandro Zifiglio, Jan 14, 2004
    #2
    1. Advertising

  3. Grant Mills

    Grant Mills Guest

    Thank you soooo much ! :)

    I got the <p> working, though that didn't keep my text formatted, so I just
    changed it to a <pre> tag, and now everything works perfectly!!! ^_^


    This just made my day!


    -Grant
    Grant Mills, Jan 14, 2004
    #3
  4. great, glad that helped ;)

    "Grant Mills" <> wrote in message
    news:hlkNb.16715$n44.10325@clgrps13...
    > Thank you soooo much ! :)
    >
    > I got the <p> working, though that didn't keep my text formatted, so I

    just
    > changed it to a <pre> tag, and now everything works perfectly!!! ^_^
    >
    >
    > This just made my day!
    >
    >
    > -Grant
    >
    >
    Alessandro Zifiglio, Jan 15, 2004
    #4
    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. Mark
    Replies:
    1
    Views:
    562
    Larry Barowski
    Jun 27, 2005
  2. hotadvice
    Replies:
    14
    Views:
    681
    hotadvice
    Oct 2, 2007
  3. Andy B.
    Replies:
    0
    Views:
    787
    Andy B.
    Apr 30, 2010
  4. leo
    Replies:
    1
    Views:
    255
    Bob Lehmann
    Dec 5, 2005
  5. Jim
    Replies:
    0
    Views:
    177
Loading...

Share This Page