Friday, October 09, 2009

To prevent cross-site scripting, it's important to encode data before outputting it.

Up until now, it has been quite hard to ensure you're encoding everywhere throughout your app.

It's great to see the new syntax in ASP.NET 4 to automatically encode:

First Name: <%: Model.FirstName %>
Last Name: <%: Model.FirstName %>

<form method="post">
  <%: Html.TextBox("FirstName") %>
  <%: Html.TextBox("LastName") %>

(From Phil Haack's blog)

This means that for all new web applications, you can build using <%: %> instead of <%= %>, which is great for ASP.NET MVC applications where that syntax is common.

For older applications you will be able to opt in to the new encoding syntax, but your old code will keep working exactly as it already does (perhaps insecurely, if you're not encoding!)

Here's hoping that we'll be able to replace the standard HtmlEncode with the AntiXSS goodness I described here:


posted on Friday, October 09, 2009 9:00:18 PM (New Zealand Standard Time, UTC+12:00)  #    Comments [0]
 Friday, October 02, 2009

Daniel presented this talk at the Wellington Silverlight user group last Wednesday.

I enjoyed this talk. Daniel went back to basics and showed how to get up and running with Silverlight and WPF development, covered the various layouts you can use in XAML, and went through some of the fundamentals of how XAML and code interact.

I think the part I most appreciated was the content that Daniel left out of his talk. He was very well prepared, and had intentionally kept things simple, which is hard to do when you have deep technical knowledge and enjoy sharing it - I struggle with keeping my talks focussed without diverting on a tangent.

Well done Daniel, I'm looking forward to your next talk!


posted on Friday, October 02, 2009 7:56:23 AM (New Zealand Standard Time, UTC+12:00)  #    Comments [0]

I attended Richard's Domain Driven Design introduction at the Wellington .NET user group back on the September 23.

Richard introduced Domain Driven Design and the motivations behind using it, covered the 'building blocks' and then gave some examples of how to put it in practice.

Richard has blogged the details of his talk here: Slides from my Domain Driven Design 101 Talk

I enjoyed Richard's slide deck, and his presentation style - simple slides so that my focus was on what he was saying. The parts of his talk that I took the most out of were the encapsulation of business logic into Specifications (different from the testing concept), and the explicit anti-corruption layer when interfacing with any external system.

Thanks Richard!


posted on Friday, October 02, 2009 7:51:47 AM (New Zealand Standard Time, UTC+12:00)  #    Comments [1]