Global Registration of User Controls

Posted Monday, January 3, 2005 1:41 PM by C-Dog's .NET Tip of the Day
No longer is it necessary to add a line such as the following to every single page:
 
<%@ Register TagPrefix="thrifty" Namespace ="Thrifty.Framework.Web.Navigation" Assembly="Thrifty.Framework" %>
 
Now you can add your reference to every page on the site by simply adding the following to your web.config or machine.config.
 
<configuration>
     <system.web>
            <pages>
                 <registerTagPrefixes>
                     <add
                         tagPrefix="thrifty"
                         namespace="Thrifty.Framework.Web.Navigation"/>
                  </registerTagPrefixes>
             </pages>
     </system.web>
</configuration>
 
This feature isn't terribly exciting but it will make building pages easier in the future and it will allow easy access to every control we have without having to worry if it is registered.

Read the complete post at http://www.dotnettipoftheday.com/blog.aspx?id=206