&安培; NBSP;在asp.net服务器端代码? [英]   in asp.net server side code?

查看:194
本文介绍了&安培; NBSP;在asp.net服务器端代码?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有这样的代码:

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



我也有一个标签 < ASP:标签... />

我要创建 S + + VAL

但我想那&放大器; NBSP;

我怎样才能做到这一点在的服务器的一面呢?

How can I do it in server side ?

这样做是向我展示&放大器; NBSP 为文本。 (ofcourse,因为我们正在处理myLabel的文本的持有文本。)

Doing this is showing me the &nbsp as text. ( ofcourse since we're dealing with myLabel.Text which holds a text)

我也试过:

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



任何帮助吗?

any help ?

推荐答案

&放大器; NBSP; 不同字符不是空间 - 它是Unicode代码点 00A0 。查看维基百科

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

如果您使用的字符,你应该得到一个不换行空格。

If you use that character, you should be getting a non breaking space.

这篇关于&安培; NBSP;在asp.net服务器端代码?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆