Real-World Inversion of Control and Dependency Injection with WebForms (This Is Not a Drill)

Posted on November 20, 2009


An exercise in refactoring a real-world WebForm to a more maintainable and testable one.

Inversion of Control and Dependency Injection with WebForms (In 2 Acts)

Posted on November 14, 2009


When just about everybody has written off WebForms as uncool and hailed MVC as the new Silver Bullet, I beg to differ.

Why So Averse To Exceptions?

Posted on July 19, 2009


Having done a number of code reviews with our team, I’ve noticed one common theme through all projects: developers weren’t sure what to do about unhandled exceptions.

Keeping Pulse on Your Site With ASP.NET 2.0 Health Monitoring

Posted on March 23, 2007


One of the best, yet often overlooked, features of ASP.NET 2.0 is health monitoring. I believe it is absolutely essential to be notified of any problems with your web application, and this is where health monitoring comes in handy. A few years ago I wrote an article about custom error pages and demonstrated various ways to tap into error details. Health Monitoring is a natural progression of that approach.

The Dark Side of File Uploads

Posted on January 12, 2006


I saw a December MSDN article, entitled Uploading Files in ASP.NET 2.0, and wanted to offer my comments on some gotchas with uploading files. I’ve spent countless hours and tried numerous hacks to tame file uploading and have enough bruses from hitting my head against the wall (figuratively speaking).

Session_Start or Session_OnStart?

Posted on December 18, 2005


Ever since I started to develop with ASP.NET, I’ve been wondering why global.asa from the ASP days quietly moved over to ASP.NET as global.asax. When you look at it, it just feels so outdated, so VBScript-ish, so loosely–typed. And what is the right way to name event handlers?

Crafting Lightweight Page Templates with CSS

Posted on September 19, 2004


Giving your web application a consistent look and feel is a task of paramount importance. Yet, templating in ASP.NET has been complicated, to say the least. Learn how you can craft lightweight, efficient page templates with CSS.

Weather Custom Server Control

Posted on September 11, 2004


Need a quick and easy way to display weather on your site? Templated custom server controls to the rescue!

Adding Variables To Style Sheets

Posted on July 08, 2004


Even though the spec defines CSS as a style sheet language, this language is missing one of the essential features: variables. Every time I've seen people in newsgroups ask how to implement variables in CSS a typical advice was to build the style sheet on the server. Luckily, it is easy to do in ASP.NET with the help of HTTP Handlers.

Building Dazzling Charts With Office Web Components

Posted on June 08, 2004


Need to create eye-popping charts in real time and do it at no cost at all? Give Microsoft Office Web Components a try.

Make Every Web Page Printer-Friendly

Posted on June 02, 2004


You found an article online and want to print it to nicely punch thee holes on the side and store it with other useful stuff. Almost every site nowadays provides a printer-friendly page of this and that, but some sites don't and you're still stuck with staring at their printed navigation bar, footer, ads, etc, for ever and ever. All this online decor means nothing on paper. How do you strip page parts that are irrelevant for print?

Beware Of Deploying Debug Code In Production

Posted on May 05, 2004


You have spent several months developing a killer web application (a web site, perhaps) and the long anticipated release day has come. You deploy the application and take it for a test drive. As you navigate from page to page you notice that each page “thinks” before rendering. What’s going on? Didn’t Microsoft folks promise code compilation and ultra fast execution? Isn’t it why we beat ASP, Java and PHP by such a wide margin?

Bringing CSS2 to Visual Studio.NET

Posted on April 27, 2004


Even though the CSS2 Specification has been around since 1998 its support in the Visual Studio line of products has been rather weak. In this article you’ll learn how to enhance IntelliSense in Visual Studio.NET to display CSS2 properties.

Remastering Web Form Templates

Posted on April 18, 2004


Visual Studio.NET comes with a number of templates for all kinds of coding occasions. The one I'm going to talk about in this article is the one you probably use most often (provided you are an ASP.NET developer): the Web Form template. Default templates suffer from being stuffed with needless markup. In this article we'll analyze what is supposed to be there and learn how to clean them up.

What's In Your DOCTYPE?

Posted on April 13, 2004


When you create a web form in Visual Studio.NET using the canned "Web Form" template you might ask yourself, "What is this DOCTYPE declaration about?"

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >

What is this strange-looking beast?

ASP.NET State Management: View State

Posted on March 14, 2004


ASP.NET view state is a great feature and an essential tool for web development of today. It maintains the state of a page as it travels back and forth. There is no more need to worry about restoring values of page controls between postbacks. In this article you will get an in-depth perspective on view state. We will talk about ways of reducing unnecessary payload and protecting view state from prying eyes.

Skinning Web Applications with CSS

Posted on February 22, 2004


The common approach to skinning web applications lies in reshuffling controls on a page. Traditionally developers define templates with different color schemes and/or control positioning, tables and inline font tags. While this used to be a perfectly viable solution the overhead of run-time application of these skins is staggering. A much better way is to separate skin structure from presentation and let CSS take care of the layout and typography.

Producing XHTML-Compliant Pages With Response Filters

Posted on February 13, 2004


Programming with web standards in mind, although vastly ignored, is becoming more and more important. It almost seems it took too long to promote ASP.NET. Now that we're over the hill and "this stuff works" it is about time to start paying attention to web standards. In this article you will learn how to implement a response filter and plug it into the ASP.NET pipeline. The filter will transform outgoing HTML into XHTML 1.0-compliant markup.

ASP.NET Custom Error Pages

Posted on February 01, 2004


ASP.NET provides a simple yet powerful way to deal with errors that occur in your web applications. We will look at several ways to trap errors and display friendly meaningful messages to users. We will then take the discussion a step further and learn how to be instantly notified about problems so you can cope with them right away. As a geek touch we will also track the path 404's travel.