views:

421

answers:

2

Distributing ASP.NET user controls across different projects can be really useful when you want to create a library of controls that can be used by different projects.

Unfortunately, to my knowledge, ASP.NET (2.0 at least) doesn't support this very cleanly.

The only technique I know of is to add the control to another project, then copy the ascx (and only the ascx, unless you want to extend the control of course) file into the project that references the control, and remove the CodeBehind reference from it.

It works, but it feels hackish.

Does anyone know of a better way to split controls across projects? (perhaps 3.5 helps somehow?)

+3  A: 

Check this out: How to share ASP.NET pages and user controls between applications by using Visual C# .NET

You'll find other resources like this at Google.

rodbv
+3  A: 

You could check out this article by Scott Guthrie:

Building Re-Usable ASP.NET User Control and Page Libraries with VS 2005

HectorMac