Sharing user controls across multiple websites

I am currently working on a project that includes three different websites with many common features. At the moment, the overall functionality is hosted on another website full of user controls.

The problem is sharing custom controls across multiple websites. Looking back at SO and other websites, the only solution seems to be using virtual directories. Since this is a workable solution (we are at the moment), it does not seem to be a "clean" solution.

What “best practices” exist when sharing common features (including GUI / HTML) between different sites?

Is it possible (for example) to create one web application project and deploy subdirectories (each with its own web.config) in different production environments?

+3
source share
3 answers

There is a solution for sharing user controls by creating user control libraries described by ScottGu. In my opinion, this solution is not very clean, because you need to copy the precompiled files for this solution to work.

- . , , Scotts .

+1

, " ", . , Microsoft , .

...

, :

  • . , . , ascx .
  • . ascx - .

, Virtual Directory №2 " " №2, №1. " " , ascx , , " ". , : . , " " , .dll.

, # 1, . - . , symlink, .

# 2, - , . , -. , , ( -, ).

, !

+3

IMHO it is better to use the Virtual Directory solution, even if it is not clean. This will solve a lot of headaches, since you can use it for several websites without the need to deploy additional files on each website, and if there are changes, you need to do this in only one place.

NTN

0
source

Source: https://habr.com/ru/post/1741043/


All Articles