Show HTML String

J

Just D.

All,

What's the simplest way to show my own HTML string on the ASPX page assuming
that this page is just created using the wizard and it has nothing on it?
We're free to use any control adding it to this page just to show this HTML
string. I know that in some cases we can use .InnerHtml property of some
controls to inject the HTML string created in C# code, but it didn't work in
my case. I tried to use TEXTAREA1.InnerHtml and it shows me the HTML string
instead of formatted string. What's wrong?

Just D.
 
G

Guest

are you trying to display html tags as string literals which are created from
the server side? or are you trying to render html tags generated from the
server?

ie. do you want "<table><tr>..." shown up to the user or do you want an
actual table?

for an actual table which gets created from server side code you can use
literalcontrol class (i think that is right anyway).

if you want string literal of html tags I think you have to look up escape
ascii codes for that ( i think). i also think some controls have an option to
not render as HTML.

If by chance what you are wanting is more basic say have HTML tags inside a
aspx page all you need to do is make sure <html> <body> etc are not in the
HTML you are intrested in displaying.

So for example if you have a HTML page already just copy everything past
<body> or <form> basically all ASPX content is rendered inside a form tag so
no form inside a form if that makes sense.
 
P

PeterKellner

All,

What's the simplest way to show my own HTML string on the ASPX page assuming
that this page is just created using the wizard and it has nothing on it?
We're free to use any control adding it to this page just to show this HTML
string. I know that in some cases we can use .InnerHtml property of some
controls to inject the HTML string created in C# code, but it didn't work in
my case. I tried to use TEXTAREA1.InnerHtml and it shows me the HTML string
instead of formatted string. What's wrong?

Just D.

I'd suggest using the text property of the Label control
Peter Kellner
http://peterkellner.net
 
G

Guest

if you do <br/> on the .text value of a textbox control it does not render
display as <br/> but rather gives a new line.

So it does depend on what he means when he says html if you follow what I am
saying.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top