<rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>ASP.NET 4 "Quick Hit" – The HtmlEncoder Utility Method</title><link>http://www.asp.net</link><pubDate>Tue, 15 Mar 2011 06:06:30 GMT</pubDate><generator>umbraco</generator><description>Comments for ASP.NET 4 "Quick Hit" – The HtmlEncoder Utility Method</description><language>en</language><atom:link href="http://www.asp.net/rss/comments/33677" rel="self" type="application/rss+xml" /><item><title>Comment Posted by Corgalore</title><link>http://www.asp.net/web-forms/videos/net-4/core/aspnet-4-quick-hit-the-htmlencoder-utility-method</link><pubDate>Thu, 12 Nov 2009 17:32:55 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-000000008575</guid><description><![CDATA[ <p>Joe, this is not a .NET 4.0 feature as I have been using that class method for quite a while already, probably since .NET 2.0</p>]]></description><enclosure length="0" type="image/png" url="http://i3.asp.net/avatar/Corgalore.jpg?forceidenticon=false&amp;dt=635047515600000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by Mattw67</title><link>http://www.asp.net/web-forms/videos/net-4/core/aspnet-4-quick-hit-the-htmlencoder-utility-method</link><pubDate>Fri, 13 Nov 2009 13:34:49 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-000000008576</guid><description><![CDATA[ <p>I agree with Corgalore.</p>]]></description><enclosure length="0" type="image/png" url="http://i3.asp.net/avatar/Mattw67.jpg?forceidenticon=false&amp;dt=635047515600000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by muratyasar</title><link>http://www.asp.net/web-forms/videos/net-4/core/aspnet-4-quick-hit-the-htmlencoder-utility-method</link><pubDate>Mon, 16 Nov 2009 21:25:35 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-000000008577</guid><description><![CDATA[ <p>Good videos as always Joe. Thanks for your effort and I agree with Corgalore.</p>]]></description><enclosure length="0" type="image/png" url="http://i3.asp.net/avatar/muratyasar.jpg?forceidenticon=false&amp;dt=635047515600000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by Goudinov</title><link>http://www.asp.net/web-forms/videos/net-4/core/aspnet-4-quick-hit-the-htmlencoder-utility-method</link><pubDate>Wed, 18 Nov 2009 23:01:01 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-000000008578</guid><description><![CDATA[ <p>I&#39;ve been using this since ASP Classic!</p><p></p><p>Server.HtmlEncode(s)</p><p></p><p>Maybe the difference is that now it&#39;s managed?  Dunno.</p>]]></description><enclosure length="0" type="image/png" url="http://i1.asp.net/avatar/Goudinov.jpg?forceidenticon=false&amp;dt=635047515600000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by atomiton</title><link>http://www.asp.net/web-forms/videos/net-4/core/aspnet-4-quick-hit-the-htmlencoder-utility-method</link><pubDate>Thu, 31 Dec 2009 19:32:39 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-000000008579</guid><description><![CDATA[ <p>This mechanism exists in Asp.Net 2.0. It&#39;s not a new mechanism, unless something has been changed/improved in 4.0 version.</p>]]></description><enclosure length="0" type="image/png" url="http://i1.asp.net/avatar/atomiton.jpg?forceidenticon=false&amp;dt=635047515600000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by JoeStagner</title><link>http://www.asp.net/web-forms/videos/net-4/core/aspnet-4-quick-hit-the-htmlencoder-utility-method</link><pubDate>Thu, 14 Jan 2010 19:10:13 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-000000008580</guid><description><![CDATA[ <p>No guys. </p><p></p><p>The was a encoding method in the Server Object (Server.HTMLEncode) but now there is an easily accessable HttpUtility Object with an HtmlEncode. </p><p></p><p>Always easily available in an object that can be easily enherited or extended. </p>]]></description><enclosure length="0" type="image/png" url="http://i1.asp.net/avatar/JoeStagner.jpg?forceidenticon=false&amp;dt=635047515600000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by zubairdotnet</title><link>http://www.asp.net/web-forms/videos/net-4/core/aspnet-4-quick-hit-the-htmlencoder-utility-method</link><pubDate>Fri, 29 Jan 2010 11:24:18 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-000000008581</guid><description><![CDATA[ <p>That class existed in .NET for a while, infact I built an extension method to allow it to be easy accessible so you can do eg TrustedInput = UntrustedInput.HtmlEncode(); &amp; TrustedInput = UntrustedInput.HtmlDecode(); </p><p></p><p>Check out this method in my Extension methods library <a rel="nofollow" href="http://bit.ly/1MhkO" target="_blank">bit.ly/</a></p>]]></description><enclosure length="0" type="image/png" url="http://i1.asp.net/avatar/zubairdotnet.jpg?forceidenticon=false&amp;dt=635047515600000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by ndarwish</title><link>http://www.asp.net/web-forms/videos/net-4/core/aspnet-4-quick-hit-the-htmlencoder-utility-method</link><pubDate>Sun, 31 Jan 2010 13:30:09 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-000000008582</guid><description><![CDATA[ <p>HttpUtility.HtmlEncode is there since .NET 1 !!</p><p>For reference, you can check MSDN:</p><p><a rel="nofollow" href="http://msdn.microsoft.com/en-us/library/system.web.httputility.htmlencode(VS.71).aspx" target="_blank">msdn.microsoft.com/</a></p><p>www.msdn.microsoft.com/en-us/library/system.web.httputility.htmlencode(VS.71).aspx</p>]]></description><enclosure length="0" type="image/png" url="http://i3.asp.net/avatar/ndarwish.jpg?forceidenticon=false&amp;dt=635047515600000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by SvDeursen</title><link>http://www.asp.net/web-forms/videos/net-4/core/aspnet-4-quick-hit-the-htmlencoder-utility-method</link><pubDate>Sun, 31 Jan 2010 19:58:59 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-000000008583</guid><description><![CDATA[ <p>The video is misleading. HttpUtility.HtmlEncode is not new (however, there is a new HtmlEncode(object) overload). What&#39;s new here is that all encoding and decoding mechanisms in ASP.NET are based on the new HttpEncoder mechanism (<a rel="nofollow" href="http://msdn.microsoft.com/en-us/library/system.web.util.httpencoder%28VS.100%29.aspx)." target="_blank">msdn.microsoft.com/</a> It&#39;s possible to override the default encoding/decoding mechanism with a custom (safer) mechanism using the &lt;httpRuntime&gt; section. This can be useful, because the default encoding mechanism uses black list encoding, while white list encoding is much safer. It’s now possible to plug the Microsoft AntiXSS library in. I hope the ACE team soon comes with an update of their AntiXSS library that contains a HttpEncoder class.</p>]]></description><enclosure length="0" type="image/png" url="http://i1.asp.net/avatar/SvDeursen.jpg?forceidenticon=false&amp;dt=635047515600000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by ventaur</title><link>http://www.asp.net/web-forms/videos/net-4/core/aspnet-4-quick-hit-the-htmlencoder-utility-method</link><pubDate>Tue, 02 Feb 2010 15:00:56 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-000000008584</guid><description><![CDATA[ <p>That&#39;s correct; this is not new to ASP.NET 4.0. What IS new to ASP.NET 4.0 is a new output tag for markup files. Instead of using &lt;%= SomeVar %&gt;, you can use the new syntax &lt;%: SomeVar %&gt; to automatically HTML-encode the value before it is output.</p>]]></description><enclosure length="0" type="image/png" url="http://i3.asp.net/avatar/ventaur.jpg?forceidenticon=false&amp;dt=635047515600000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by pcbabu</title><link>http://www.asp.net/web-forms/videos/net-4/core/aspnet-4-quick-hit-the-htmlencoder-utility-method</link><pubDate>Sun, 14 Feb 2010 12:47:07 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-000000008585</guid><description><![CDATA[ <p>this is not a asp.net 4.0 new feature...</p>]]></description><enclosure length="0" type="image/png" url="http://i1.asp.net/avatar/pcbabu.jpg?forceidenticon=false&amp;dt=635047515600000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by xiangxiangu</title><link>http://www.asp.net/web-forms/videos/net-4/core/aspnet-4-quick-hit-the-htmlencoder-utility-method</link><pubDate>Tue, 25 May 2010 02:41:32 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-000000008910</guid><description><![CDATA[ <p>Nice Video</p>]]></description><enclosure length="0" type="image/png" url="http://i3.asp.net/avatar/xiangxiangu.jpg?forceidenticon=false&amp;dt=635047515600000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by JochenEd</title><link>http://www.asp.net/web-forms/videos/net-4/core/aspnet-4-quick-hit-the-htmlencoder-utility-method</link><pubDate>Wed, 09 Jun 2010 16:47:25 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-000000009017</guid><description><![CDATA[ <p>Regardless of how long that static method has been around, this is still cumbersome. The new markup mentioned above should have its equivalent in the web forms controls, i.e. an additional boolean property for auto-encoding and auto-decoding behaviour, so that the HTML-end gets encoded while in the code you&#39;d just be working with with the original string. This should then be applied to all other properties that end up being rendered in HTML. In case of the Label control I can&#39;t believe this hasn&#39;t been suggested and implemented long ago.</p>]]></description><enclosure length="0" type="image/png" url="http://i2.asp.net/avatar/JochenEd.jpg?forceidenticon=false&amp;dt=635047515600000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by tarikelmallah</title><link>http://www.asp.net/web-forms/videos/net-4/core/aspnet-4-quick-hit-the-htmlencoder-utility-method</link><pubDate>Tue, 15 Mar 2011 06:06:30 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000012468</guid><description><![CDATA[ <p>it was in ASP.net 2, not new !!!</p>]]></description><enclosure length="0" type="image/png" url="http://i1.asp.net/avatar/tarikelmallah.jpg?forceidenticon=false&amp;dt=635047515600000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item></channel></rss>