views:

63

answers:

1

I would like to put user controls on pages without registering the tag at the top of the page. For example:

<p>some text</p>
<myname:mycontrol runat="server" />

Is this possible? I've heard that tag declarations can be done in web.config... is this true?

If so, any idea which .NET framework versions support this?

Thanks

+5  A: 

in .net 2.0 web.config :

<pages>
    <controls>
    <add tagPrefix="MYPREFIX" namespace=="MyNamespace.Stuff" assembly="MyAssembly" />

Much more thorough discussion http://weblogs.asp.net/scottgu/archive/2006/11/26/tip-trick-how-to-register-user-controls-and-custom-controls-in-web-config.aspx

Chad Grant