User Webcontrols across several applications?

A

Axel Dahmen

Hi,

I've created several complex User Webcontrols (.ascx) which I now want to
re-use in another web application. But by definition, this is not possible.
If I now start with Copy&Paste, I'll always have to do my changes twice.
(Nonetheless it seems quite archaic to me.)

Is there perhaps a trick or a workaround? I don't want to re-engineer my
User Webcontrols into User-defined Webserver Controls.

TIA,
Axel Dahmen
 
S

Sarmad Aljazrawi

Depending on how complex your user control are, i'd change them to custom
controls/server controls which then i'd be able to add it to the toolbox and
re-use it to many applications without having to copy and paste.
 
A

Axel Dahmen

thanks. Unfortunately it's not that easy. Some of them have different
display modes others contain up to 5 asp:Repeater controls. Doing all the
rendering manually would be no fun...


------------
 
A

Alessandro Zifiglio

hi Axel,
The only way to share the user control between applications is to put a
separate copy in each application, which takes more maintenance if you make
changes to the control. This is one of the main differences btw User
Controls and Custom web controls. With Custom Web Controls you can install a
single copy of in the global assembly cache and share it between
applications, which makes maintenance easier.

However there is a small work around with limitations that Jim ross
showcases in the following article. See if that is what you want.

http://authors.aspalliance.com/JimRoss/Articles/ShareUserControls.aspx

On the other hand if you changed your mind about using a user control and
wanted a custom web control instead then know that its not as hard and as
much work as you think once you get a hang of it and know what you are
doing.

All roads lead to rome ;P
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top