M
MikeY
I found that both textbox and label renders diferently for the same string
that I have. The string looks like this:
"<something>"
Textbox renders is as it is but label sees it as a malform html tag.
I have use HTML.Decode method. Below is a sample code:
sample code:
string message1 = " <Something>";
StringWriter Message1 = new StringWriter();
Server.HtmlDecode( message1, Message1 );
this.TextBox1.Text = Message1.ToString();
this.Label1.Text = Message1.ToString();
this.txtarea.Value = Message1.ToString();
Label will not display the word <something> but if you view source you can
see it. Browser is assuming that it is a malform html tag.
I am using Label becuase this is a read only field and the data could
contain word like <something>
Any help is appreciated.
that I have. The string looks like this:
"<something>"
Textbox renders is as it is but label sees it as a malform html tag.
I have use HTML.Decode method. Below is a sample code:
sample code:
string message1 = " <Something>";
StringWriter Message1 = new StringWriter();
Server.HtmlDecode( message1, Message1 );
this.TextBox1.Text = Message1.ToString();
this.Label1.Text = Message1.ToString();
this.txtarea.Value = Message1.ToString();
Label will not display the word <something> but if you view source you can
see it. Browser is assuming that it is a malform html tag.
I am using Label becuase this is a read only field and the data could
contain word like <something>
Any help is appreciated.