views:

40

answers:

1

How can I embed a user control in a DLL?

Ideally, I would still be able to define the control's markup in an ascx file, but if I understand correctly you cannot embed template files into DLLs.

+2  A: 

Take a look at this article

http://msdn.microsoft.com/en-us/library/aa479318.aspx

It is a little hackish, essentially you need to publish your website as a an unupdatable site. Then grab the web dll from the output and reuse that in your real web project.

I'd probably just go the route of creating Server Controls. These will be easier to maintain.

Bob
When you say "Server Control", do you mean "Custom Control"? My understanding of the terminology is that "User Controls" and "Custom Controls" are both kinds of "Server Control".
ctford
Yes, I mean custom control
Bob