how can I write text from codebehind to html - without html rendering

Discussion in 'ASP .Net' started by Alex Papadimoulis, May 6, 2004.

  1. Checkout the Literal control.

    -- Alex Papadimoulis

    "Leo Muller" <> wrote in message
    news:c7ddah$96h$...
    > Hi,
    > How can I write text from code behind without getting HTML tags added to

    it?
    > Up till now I used the label control. But when I call the label.text =
    > "something" then the HTML will output "<span>something</span>", and I want
    > to write "something" without any tags around it. (this is a simplified
    > example of course).
    >
    > (response.write from the codebehind adds the text to the beginning of the
    > page.)
    >
    > How can this be done?
    >
    > Thanks,
    >
    > Leo
    >
    >
    > --
    >
    > -----------------------------------------------
    > Leo Muller ìéàå îéìø
    > Webmaster Keshet Interactive
    >
    > 03 - 7676383 / 067 - 972985
    > --------------------------------------
    > http://www.keshet-i.com
    > http://www.mooma.com
    > http://www.hakasefet.co.il
    > http://www.bip.co.il
    > http://www.keshet-tv.com
    >
    >
    >
    >
     
    Alex Papadimoulis, May 6, 2004
    #1
    1. Advertising

  2. Try adding a SPAN to to your html with the runat set

    <SPAN id="myText" runat="server"></SPAN

    You can then access the text from the codebehind using the follow

    myText.innerHTML = "Blah Blah Blah <B>Bold Blah</B>

    Oliver
     
    =?Utf-8?B?T2xpdmVy?=, May 6, 2004
    #2
    1. Advertising

  3. Alex Papadimoulis

    Leo Muller Guest

    Hi,
    How can I write text from code behind without getting HTML tags added to it?
    Up till now I used the label control. But when I call the label.text =
    "something" then the HTML will output "<span>something</span>", and I want
    to write "something" without any tags around it. (this is a simplified
    example of course).

    (response.write from the codebehind adds the text to the beginning of the
    page.)

    How can this be done?

    Thanks,

    Leo


    --

    -----------------------------------------------
    Leo Muller ìéàå îéìø
    Webmaster Keshet Interactive

    03 - 7676383 / 067 - 972985
    --------------------------------------
    http://www.keshet-i.com
    http://www.mooma.com
    http://www.hakasefet.co.il
    http://www.bip.co.il
    http://www.keshet-tv.com
     
    Leo Muller, May 6, 2004
    #3
  4. Alex Papadimoulis

    Leo Muller Guest

    Thanks!

    "Alex Papadimoulis" <> wrote in message
    news:...
    > Checkout the Literal control.
    >
    > -- Alex Papadimoulis
    >
    > "Leo Muller" <> wrote in message
    > news:c7ddah$96h$...
    > > Hi,
    > > How can I write text from code behind without getting HTML tags added to

    > it?
    > > Up till now I used the label control. But when I call the label.text =
    > > "something" then the HTML will output "<span>something</span>", and I

    want
    > > to write "something" without any tags around it. (this is a simplified
    > > example of course).
    > >
    > > (response.write from the codebehind adds the text to the beginning of

    the
    > > page.)
    > >
    > > How can this be done?
    > >
    > > Thanks,
    > >
    > > Leo
    > >
    > >
    > > --
    > >
    > > -----------------------------------------------
    > > Leo Muller ìéàå îéìø
    > > Webmaster Keshet Interactive
    > >
    > > 03 - 7676383 / 067 - 972985
    > > --------------------------------------
    > > http://www.keshet-i.com
    > > http://www.mooma.com
    > > http://www.hakasefet.co.il
    > > http://www.bip.co.il
    > > http://www.keshet-tv.com
    > >
    > >
    > >
    > >

    >
    >
     
    Leo Muller, May 6, 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. Ravindra
    Replies:
    2
    Views:
    452
    Natty Gur
    Dec 19, 2003
  2. Peter Mount
    Replies:
    4
    Views:
    1,000
    Peter Mount
    Jan 31, 2006
  3. could ildg
    Replies:
    0
    Views:
    490
    could ildg
    Jul 1, 2005
  4. Jeff Epler
    Replies:
    0
    Views:
    410
    Jeff Epler
    Jul 1, 2005
  5. could ildg
    Replies:
    0
    Views:
    522
    could ildg
    Jul 2, 2005
Loading...

Share This Page