Real-World Inversion of Control and Dependency Injection with WebForms (This Is Not a Drill)
Posted by: AspNetResources.com articles, news and updates,
on 24 Jan 2014 |
View original | Bookmarked: 0 time(s)
An exercise in refactoring a real-world WebForm to a more maintainable and testable one.Suppose we have a Contact Us page. Old school, with all the logic in code-behind. I borrowed it from an old project, but I’ve written plenty of those myself over the years, and I’m sure so have you.
public partial class Contact1 : Page
private void SubmitFeedback (object sender, EventArgs e)
string to, from;