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

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

P: n/a
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
Le********@Keshet-TV.com
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


Nov 18 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
Checkout the Literal control.

-- Alex Papadimoulis

"Leo Muller" <le***@keshet-i.com> wrote in message
news:c7**********@news2.netvision.net.il...
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
Le********@Keshet-TV.com
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

Nov 18 '05 #2

P: n/a
Thanks!

"Alex Papadimoulis" <al***@papadimoulis.com> wrote in message
news:OM**************@TK2MSFTNGP11.phx.gbl...
Checkout the Literal control.

-- Alex Papadimoulis

"Leo Muller" <le***@keshet-i.com> wrote in message
news:c7**********@news2.netvision.net.il...
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
Le********@Keshet-TV.com
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


Nov 18 '05 #3

P: n/a
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
Nov 18 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.