Welcome to MSDN Blogs Sign in | Join | Help

SYSK 332: How To Register Custom Controls Once For All Web Pages

Did you know that since .NET 2.0 you can define register directives in the <pages> element in your configuration instead of using @Register directive on every page?  It’s especially useful if you’re using a custom control(s) in multiple web pages.  Here is an example of registering controls from MyControlLibrary assembly and controls from the web project itself:

 

<pages>

      <controls>

            <add namespace="WebSite1" tagPrefix="lc" />

            <add namespace="MyControls" tagPrefix="cc" assembly="MyControlLibrary"/>

      </controls>

</pages>

 

 

Published Thursday, April 19, 2007 5:04 AM by irenak

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS

Comments

No Comments

Leave a Comment

(required) 
required 
(required) 

  
Enter Code Here: Required
 
Page view tracker