gridview最新書籤


Icon_arrow_right 1148 天前 
Icon_arrow_right 1162 天前 
Icon_arrow_right 1280 天前 
Icon_arrow_right 1282 天前 
Icon_arrow_right 1283 天前 
Icon_arrow_right 1395 天前 
Icon_arrow_right 1403 天前 
Icon_arrow_right 1801 天前 
611765

黑暗執行緒 : TIPS-GridView DataFormString Not Applied Popup

黑暗執行緒 : TIPS-GridView DataFormString Not Applied Popup

原文來自 黑暗執行緒
elleryq 收藏於 2007/06/25
ASP.NET 2.0 GridView裡加了一個BoundField,資料型別是日期,我打算把DataFormatString設成{0:yyyy-MM-dd HH:mm:ss}讓它顯示得更整齊一點,但網頁上ASP.NET並沒有套用我指定的格式。如果我火大連{0:...}都不加,而把它調成"SHIT"之類的發洩性字眼,GridView倒是乖乖地拉出一大堆狗屎... orz 試了好久,最後查到網路上的相關文章,說將HtmlEncode屬性設為false即可解決DataFormatString設定無效的問題,並視之為BUG。但我最後追到MS關於BoundField.DataFormatString的官方Reference,裡面有一段Note: When the HtmlEncode property is true, the value of the field is HTML encoded to its string representation before the formatting string is applied. For some objects, such as dates, you might want to control how the object is displayed with a formatting string. In those cases, you must set the HtmlEncode property to false.
[推薦] 點點印,把你的照片變成寫真書/照片書!
[2012] 做自己的畢業紀念冊畢業禮物推薦

這些內容是怎麼產生的?

黑米沒有編輯,所有內容都是使用者貢獻。網站每天會分析最近最多人收藏的書籤,越多人收藏,排在越上面。綠色的數字代表收藏推薦的人數。

書籤心得

需要幫忙嗎?
黑米小工具

黑米數位版權所有 Copyright© 2006-2008 HEMiDEMi. All Rights Reserved.