Forum Moderators: open

Message Too Old, No Replies

shared controls?

used by multiple sites

         

httpwebwitch

1:51 am on Aug 17, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I have built some user controls that I want to use on about 30 different sites all living on the same webserver. I don't want to deploy 30 copies of the same ascx files; that seems dumb.

how?

and - is there a way to make these tools available by default without putting a register directive on every page?

satalways

9:20 am on Aug 17, 2005 (gmt 0)

10+ Year Member



You should make session variables in global.asa for register once ...

tomasz

11:29 am on Aug 17, 2005 (gmt 0)

10+ Year Member



You can create one project with all of your common user controls then compile it add new dll reference to all of existing projects and you can dynamically add them to your website without using "register tag"

all pages will have placercontrol (plc)

Dim ctl As Control = LoadControl("../Controls/header.ascx")
CType(ctl, header).WebsiteName = WebsiteName
plc.Controls.Add(ctl)

TheNige

8:13 pm on Aug 17, 2005 (gmt 0)

10+ Year Member



You can also re-use controls by making custom server controls. They are more complicated to create but you can then just copy the dll into your various bin folders and you don't have any ascx files.

You can then add your control to the visual studio tool box and then just drag and drop it to the page without a need for the page register line.