Add a user control reference

In (classic) ASP.NET 1.1 you had to reference a user control in every page you wanted to use the control in (@Page-directive).

ASP.NET 2.0 lightens this work because it allows you to reference heavily used user controls globally in the web.config file.

When you have added something like this to your web.config:

<pages>
  <controls>
    <
add tagPrefix="qd"
         src="~/UI/Controls/ProductList.ascx"
         tagName="ProductList"/>
  </
controls>
</
pages>

your user control is avaible in every page of your web project accessing it via

<qd:ProductList ID="qdProductList" runat="Server" />

And you have full intellisense support for your user control, of course.

Share this post: | | | |
Published Saturday, February 11, 2006 1:09 AM by agung

Comments

No Comments