Encoding Output in ASP.Net 4 and MVC 2

I’ve been developing in MVC 2 for a week now and a new feature I’ve found really handy is automatic HTML encoding using <%: %>

I've been developing in MVC 2 for a week now and a new feature I've found really neat is automatic HTML encoding using <%: %>

Previously to protect your website against a vandilizing technique used by hackers known as Cross Site Scripting (XSS) you would have to include a HtmlEncode call like so :

<%= Server.HtmlEncode(Model.CustomerFirstName) %>

but now all it takes is:

<%: Model.CustomerFirstName %>

As I mentioned I'm only a week into .Net 4 and MVC 2 so hopefully I'll have plenty more of these gems to report on as I find them