Saturday, June 30, 2007

Declare ASP.NET Controls in web.config Instead of Individual Pages

Instead of declaring controls on individual ASPX pages, declare them once in web.config.

<system.web>
<pages>
<controls>
<add tagPrefix="myCompany" src="~/ctl/usercontrol.ascx" tagName="MyControl"/>
<add tagPrefix="otherCompany" assembly="OtherControlAssembly"/>
</controls>
</pages>
</system.web>

No comments: