ASP.NET DropDownList列表项添加前导空格(Leading Space)的两种方法
来源:互联网 发布:linux下载安装包命令 编辑:程序博客网 时间:2024/04/30 21:14
我们知道:RFC 1866中定义了一个named entity,即 ASCII是160;
方法一:
char nbsp = (char)0xA0;
dropDownList.Items.Add( new ListItem( "test3".PadLeft(10,nbsp) , "4" ) );
注释:
String.PadLeft( int totalWidth , char paddingChar )
Parameters:
totalWidth:
The number of characters in the resulting string, equal to the number of
original characters plus any additional padding characters.
paddingChar:
A Unicode padding character.
Returns:
A new string that is equivalent to this instance, but right-aligned and padded
on the left with as many paddingChar characters as needed to create a length
of totalWidth. Or, if totalWidth is less than the length of this instance,
a new string that is identical to this instance.
方法二:
dropDownList.Items.Add( new ListItem( Server.HtmlDecode( "   ") + "test3", "4" ) );
注释:
Server.HtmlDecode( string s )
Parameters:
s:
The HTML string to decode.
Returns:
The decoded text.
Summary:
Decodes an HTML-encoded string and returns the decoded string.
- ASP.NET DropDownList列表项添加前导空格(Leading Space)的两种方法
- ASP.NET DropDownList列表项添加前导空格(Leading Space)的两种方法
- asp.net DropDownList 添加空格。
- DropDownList的Item中插入前导空格
- 在asp.net下实现Option条目中填充前导空格的方法
- ASP.NET给 DropDownList列表Text前加入空格
- 两种添加数据到dropdownlist控件的方法_asp.net技巧
- asp.net实现DropDownList、ListBox无刷新三级联动的两种方法
- asp.net实现DropDownList、ListBox无刷新三级联动的两种方法
- 两种添加数据到WEB DropDownList 控件的方法
- DropdownList绑定的两种方法
- DropDownList绑定数据的两种方法
- DropDownList绑定的两种方法
- DropdownList绑定的两种方法
- DropdownList绑定的两种方法 .
- DropdownList绑定的两种方法
- DropdownList绑定的两种方法
- asp.net 全国省份DropDownList下拉列表
- SQL脚本注入的不常见方法概括
- 一个完整的servlet+ajax验证码
- Java数组排序(冒泡,选择,插入,希尔)
- 数据库组件 Hxj.Data (二十四)(Sqlite数据库)
- 有关oracle数据库的三种不同操作
- ASP.NET DropDownList列表项添加前导空格(Leading Space)的两种方法
- zigbee无线模块
- 架构师最害怕程序员知道的十件事
- asp.net计划任务
- 创建文件(读和写,删除)
- servlet struts2清除页面缓存
- FoxitReader3.0注册码和foxit pdf creator key & foxit pdf editor v2.0 key
- asp常用函数
- C++ 友元函数用法。