[thelist] ASP.net code reusability

Ken Schaefer ken.schaefer at gmail.com
Wed Aug 11 18:23:42 CDT 2004


If the component has some kind of UI interaction, then I would use a
user-control. If the component doesn't, I would create a server
control (I think that's what you mean by a custom control).

At the moment, with your central include file, do you maintain a copy
for each website? If so, you'd do the same with your user or server
control. Alternatively, if you have one central virtual folder that
stores the includes for /all/ websites, you can do the same thing with
your user / server controls (just bear in mind that the folder needs
to be called "bin" for assemblies that you do not want to register in
the GAC)

Cheers
Ken

On Wed, 11 Aug 2004 15:14:48 +0100, Mark Aldrich <maldrich at cex.co.uk> wrote:
> Hi there.
> 
> For the last couple of weeks I've been ploghing into ASP.net for the first
> time. which is fine, its starting to seem like a very good way of doing
> things (when money is no object :) ).
> 
>        Anyways im moving some simple web apps over from our original asp
> code, and one thing that im finding tough is replacing blocks of
> functionality we previously kept in a global location on the webserver for
> example the page header called by <!--include >, of which i kept one copy
> and only ever edited one copy.
>        I rebuilt this into an ASP.net user control and it works perfectly
> but what i really need to do is make this accessible as a component for
> future web apps, i.e i dont want to copy and paste it for every new app, but
> this isnt immiediately obvious, custom controls seems a bit beyond the needs
> of this simple control, and registering things in the global assembly cache
> is a nightmare, surely there is an easier way, any advice out there?
> 
> thanks everyone
> 
> markA


More information about the thelist mailing list