I am currently in the process of making a new ASP.net MVC website, and find myself using Html.Encode all over the place, which is good practice, but gets pretty messy. I think a good way to clean this up would be if I could overload an operator to automatically do Html encoding.
Previously:
<%= Html.Encode( ViewData['username'] ) %>
Would be equivalent to:
<%=h ViewData['username'] %>
Anyone have any ideas how I could do this, maybe using an extension method or something?