I want...">

& nbsp; in asp.net server system code?

I have this code:

string s = "royi";
string val = "5";

I also have label <asp:Label ..../>

I want to create s+" "+val

but I want to " "be&nbsp;

How can I do this server side?

Doing this shows me text  as text. (of course, since we are dealing with myLabel.Text, which contains text)

I also tried:

HttpUtility.HtmlEncode(s + "&nbsp;" + val);

any help?

+5
source share
1 answer

&nbsp;is a different character than the space - this is the Unicode code point 00A0. See Wikipedia .

If you use this character, you should get uncommitted space.

+13
source

All Articles