<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Formatting bound ASP.NET types requires explicitly changing the HtmlEncode property</title><link>http://blogs.msdn.com/b/danielfe/archive/2006/02/08/527628.aspx</link><description>I ran into this one while migrating our Beta 2 code to VS RTM for an internal reporting site, but the behavior for ASP.NET 2.0 changed within betas and, in short, anytime you want to add a formatting string, like any of the numeric or date format strings</description><dc:language>en-US</dc:language><generator>Telligent Evolution Platform Developer Build (Build: 5.6.50428.7875)</generator><item><title>DataGridView使用技巧大全</title><link>http://blogs.msdn.com/b/danielfe/archive/2006/02/08/527628.aspx#9550182</link><pubDate>Wed, 15 Apr 2009 10:07:04 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9550182</guid><dc:creator>yanchen</dc:creator><description>&lt;p&gt;收集一些在DataGridVeiw使用技巧，备用。&lt;/p&gt;
&lt;p&gt;一、DataGridView单元格验证&lt;/p&gt;
&lt;p&gt;1、定义单元格验证要求：验证错误后焦点不离开。实现：单元格的验证可以使用dgv_details_Cel...&lt;/p&gt;
&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9550182" width="1" height="1"&gt;</description></item><item><title>re: Formatting bound ASP.NET types requires explicitly changing the HtmlEncode property</title><link>http://blogs.msdn.com/b/danielfe/archive/2006/02/08/527628.aspx#8215298</link><pubDate>Sat, 15 Mar 2008 04:44:19 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8215298</guid><dc:creator>guy</dc:creator><description>&lt;p&gt;This is no longer true. &amp;nbsp;It displays the formatting whether you set it to false or true, but on some workstations it may still show the formatting to be absent. &amp;nbsp;Upload it to the Web and it'll work just fine. &amp;nbsp;I think it's something that got patched in a framework or VS update.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8215298" width="1" height="1"&gt;</description></item><item><title>re: Formatting bound ASP.NET types requires explicitly changing the HtmlEncode property</title><link>http://blogs.msdn.com/b/danielfe/archive/2006/02/08/527628.aspx#7292131</link><pubDate>Mon, 28 Jan 2008 22:57:40 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:7292131</guid><dc:creator>Wayne</dc:creator><description>&lt;p&gt;I hit this as well, seems pretty silly. &amp;nbsp;thanks for the info!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=7292131" width="1" height="1"&gt;</description></item><item><title>在GridView中如何格式化Money型字段（downmoon)?</title><link>http://blogs.msdn.com/b/danielfe/archive/2006/02/08/527628.aspx#6907379</link><pubDate>Sun, 30 Dec 2007 14:32:57 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:6907379</guid><dc:creator>邀月</dc:creator><description>&lt;p&gt;在GridView中如何格式化Money型字段（downmoon)?&lt;/p&gt;
&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=6907379" width="1" height="1"&gt;</description></item><item><title>在GridView中如何格式化Money型字段（downmoon)?</title><link>http://blogs.msdn.com/b/danielfe/archive/2006/02/08/527628.aspx#5807928</link><pubDate>Thu, 01 Nov 2007 04:46:39 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:5807928</guid><dc:creator>downmoon</dc:creator><description>&lt;p&gt;在GridView中如何格式化Money型字段（downmoon)?&lt;/p&gt;
&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=5807928" width="1" height="1"&gt;</description></item><item><title>re: Formatting bound ASP.NET types requires explicitly changing the HtmlEncode property</title><link>http://blogs.msdn.com/b/danielfe/archive/2006/02/08/527628.aspx#1452559</link><pubDate>Fri, 12 Jan 2007 01:57:18 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1452559</guid><dc:creator>Dean</dc:creator><description>&lt;p&gt;Thanks for this, I was just starting to pull my last few remaining hairs out. What a stupid design flaw!&lt;/p&gt;
&lt;p&gt;The fields that I was binding to where double &amp;amp; datetime. How can they be prone to html encoding problems?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=1452559" width="1" height="1"&gt;</description></item><item><title>re: Formatting bound ASP.NET types requires explicitly changing the HtmlEncode property</title><link>http://blogs.msdn.com/b/danielfe/archive/2006/02/08/527628.aspx#528080</link><pubDate>Thu, 09 Feb 2006 03:32:01 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:528080</guid><dc:creator>Ruben</dc:creator><description>Also, {0:N} with HtmlEncode off doesn't work for me (Reflector seems to agree on that ;-) At least it's consistent. But unless I'd read your blog, it would have been a loooong search to find the cause of DataFormatString not working. Thanks!&lt;br /&gt;&lt;br /&gt;Overriding BoundField.FormatDataValue would be an option, as it's virtual. Hmmm...&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=528080" width="1" height="1"&gt;</description></item><item><title>re: Formatting bound ASP.NET types requires explicitly changing the HtmlEncode property</title><link>http://blogs.msdn.com/b/danielfe/archive/2006/02/08/527628.aspx#528074</link><pubDate>Thu, 09 Feb 2006 03:20:38 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:528074</guid><dc:creator>Ruben</dc:creator><description>I think that qualifies as a bug. Or a dumb design flaw. The HtmlEncode should be applied AFTER the DataFormatString. This behavior is just silly and really confusing.&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=528074" width="1" height="1"&gt;</description></item><item><title>re: Formatting bound ASP.NET types requires explicitly changing the HtmlEncode property</title><link>http://blogs.msdn.com/b/danielfe/archive/2006/02/08/527628.aspx#527772</link><pubDate>Wed, 08 Feb 2006 22:12:49 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:527772</guid><dc:creator>Kevin Daly</dc:creator><description>That's worth knowing...&lt;br /&gt;Um, I know this isn't the right place, but could I make a suggestion for an enhancement?&lt;br /&gt;Since it doesn't seem reasonable that someone would every explicitly set a format string that they wanted to be ignored, would it be possible to make setting a format string attribute automatically cause an HtmlEncode attribute with value &amp;quot;False&amp;quot; to be added?&lt;br /&gt;Or at least have that behaviour available as a configurable option?&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=527772" width="1" height="1"&gt;</description></item><item><title>re: Formatting bound ASP.NET types requires explicitly changing the HtmlEncode property</title><link>http://blogs.msdn.com/b/danielfe/archive/2006/02/08/527628.aspx#527697</link><pubDate>Wed, 08 Feb 2006 20:26:58 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:527697</guid><dc:creator>Mads Kristensen</dc:creator><description>I've experienced the same thing. It makes no sense, since the format string doesn't include any characters that is being htmlencoded. However, if you change your formatstring to {0:N} it will work without htmlencode=false.&lt;br /&gt;&lt;br /&gt;----------------------------------------------------&lt;br /&gt;www.madskristensen.dk &lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=527697" width="1" height="1"&gt;</description></item></channel></rss>