Add your WebControls to your Web.Config to Simplify References

Ever get sick of repeating the same user control registrations at the top of your user controls, pages, and master pages within your web application?  If so, you might want to try the following to save your self from all that typing.

Add this to your web.config (of course modifying it for your controls and control namespaces):

add tagPrefix=mylib namespace=My.Web.Components assembly=My.Web/>

And of course you can have multiple entries in the list.

This entry was posted in C#. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *