0

I am very exited to find out how to do this.

I have created 10 custom webusercontrols which is meant to be used on several custom sites on my website etc. and I want to find out how I can make a directory which will work the same as the asp.net.

At the moment I have to register the webusercontrol at the top of the page like this:

<%@ Register TagPrefix="prefix" TagName="UserControl" Src="Source" %>

How do I create a directory that contains all of my webusercontrols, so I only have to register the assembly and can use the prefix and then the intellisense will appear?

<MyPrefix:'list of my controls' />

1 Answers1

1

You can register user controls in the web.config so you don't have to register them on every page

<pages>
<controls>
<add tagPrefix="myprefix" src="~/mycontrol.ascx" tagName="MyControl" />
</controls>
</pages>

I think this will achieve what you're trying to do, you'll get intellisense when you type the prefix

JudyB
  • 31
  • 1
  • What if I want it to be portable, meaning I want to create a DLL file containing them so I can use them in other projects too so I don't have to recreate them every time? –  Jan 27 '11 at 10:30
  • ah right - sorry not sure - probably in the deployment options somewhere. – JudyB Jan 28 '11 at 14:33