Register Controls via Web.Config

Date Published: 27 August 2005

Register Controls via Web.Config

I had a conversation with ScottW about this about a year ago (almost exactly, from Iraq, no less), and yet I still keep forgetting this technique every time I need it. So I’m blogging it myself this time just to try to keep it in my (online) memory bank.

NOTE TO SELF: IF YOU WANT TO USE CONTROLS FROM APP_CODE IN A PAGE YOU NEED TO DEFINE THE REFERENCE IN WEB.CONFIG, NOT IN A <%@ Register %>BLOCK.

Here’s a sample:

Observant readers may notice that I’m playing with Post-Cache Substitution at the moment, along with some samples from Nikhil Kothari, found here.

Steve Smith

About Ardalis

Software Architect

Steve is an experienced software architect and trainer, focusing on code quality and Domain-Driven Design with .NET.