All articles| All Pictures| All Softwares| All Video| Go home page| Write articles| Upload pictures

Reading number is top 10 articles
解决,ASP.NET,中目录访问权限的问题_[Asp.Net教程]
.net2.0中使用SqlBulkCopy进行大批量数据迁移_[Asp.Net教程]
用PHP将整个网站生成HTML_php资料_编程技术
《Effective,C#》-使用成员初始化语句_.net资料_编程技术
C#教程:C#2.0 新特性 泛值
asp.net,自定义分页控件_[Asp.Net教程]
ASP.NET&Spring.NET&NHibernate最佳实践(三)——第2章环境准备_[Asp.Net教程]
使用,C#,编程对,RTF,文档进行操作_.net资料_编程技术
关于ASP.NET编程中的嵌套If语句_.net资料_编程技术
一个完整、安全的用户登录系统_[PHP教程]
Reading number is top 10 pictures
No trading, no killing
29 the belle stars after bath figure4
India's national beauty of the college students
Sora aoi mirror memorial classics5
The money of more than 100 countries and regions3
So beauty, will let you spray blood8
含苞欲放的素颜美少女1
8090后结婚的各种XX事
Players in the eyes of a perfect love1
Azusa Yamamoto2
Download software ranking
Be there or be square
Eclipse 4.2.1 For Win32
Tram sex maniac 2 (H) rar bag13
Unix video tutorial8
VC++6.0培训教程
Ashlynn Video5
Unix video tutorial11
都市狐狸姑娘传
圣殿祭司的ASP.NET.2.0.开发详解-使用C#
Prostitutes diary
归海一刀 published in(发表于) 2014/1/30 1:28:02 Edit(编辑)
GridView列显示时间货币格式字符串_[Asp.Net教程]

GridView列显示时间货币格式字符串_[Asp.Net教程]

GridView列显示时间货币格式字符串_[Asp.Net教程]
效果图:
图1-未格式化前

图2-格式化后

解决方法:
在asp.net 2.0中,如果要在绑定列中显示比如日期格式等,如果用下面的方法是显示不了的
DataFormatString="{0:M-dd-yyyy}"
HeaderText="CreationDate" />
主要是由于htmlencode属性默认设置为true,已防止XSS攻击,安全起见而用的,所以,可以有以下两种方法解决
1、


DataFormatString="{0:M-dd-yyyy}"
HtmlEncode="false"
HeaderText="CreationDate" />


将htmlencode设置为false即可
另外的解决方法为,使用模版列




Text=’<%# Eval("CreationDate", "{0:M-dd-yyyy}") %>’>



Text=’<%# Bind("CreationDate", "{0:M-dd-yyyy}") %>’>







添加到del.icio.us 添加到新浪ViVi 添加到百度搜藏 添加到POCO网摘 添加到天天网摘365Key 添加到和讯网摘 添加到天极网摘 添加到黑米书签 添加到QQ书签 添加到雅虎收藏 添加到奇客发现 diigo it 添加到饭否 添加到飞豆订阅 添加到抓虾收藏 添加到鲜果订阅 digg it 貼到funP 添加到有道阅读 Live Favorites 添加到Newsvine 打印本页 用Email发送本页 在Facebook上分享


Disclaimer Privacy Policy About us Site Map

If you have any requirements, please contact webmaster。(如果有什么要求,请联系站长)
Copyright ©2011-
uuhomepage.com, Inc. All rights reserved.