My Blog

  Home  |   Contact  |   Syndication    |   Login
  8 Posts | 0 Stories | 17 Comments | 0 Trackbacks

News

Archives

April 2010 Entries

In this post I look into the code smell that is HTML literals and show how we can refactor these pesky strings into a friendlier and more maintainable model. The Problem When I started writing MVC applications, I quickly realized that I built a lot of my HTML inside HtmlHelpers. As I did this, I ended up moving quite a bit of HTML into string literals inside my helper classes. As I wanted to add more attributes (such as classes) to my tags, I needed to keep adding overloads to my helpers. A good...