Best way to share ASP.NET .ascx controls across different website applications?

后端 未结 10 640
轮回少年
轮回少年 2021-01-04 04:39

Suppose you have 2 different ASP.NET applications in IIS. Also, you have some ASCX controls that you want to share across these 2 applications.

What\'s the best way

相关标签:
10条回答
  • 2021-01-04 05:06

    I have a suggestion.WE can use user control across multiples application by creating user control inside website project as normally.Then change the website property Use fixed naming and single page assemblies.Then we can use the user control dll into multiple applications.

    0 讨论(0)
  • 2021-01-04 05:14

    Scott Guthrie gives some great advice here on how to set up a User Control Library project, then use pre-build events to copy the user controls into multiple projects. It works really well.

    http://webproject.scottgu.com/CSharp/usercontrols/usercontrols.aspx

    0 讨论(0)
  • 2021-01-04 05:15

    In addition to what Tundey said, NTFS Link shell extension is helpful when it comes to sharing a large chunk of content (e.g.: a folder with .ascx/.aspx) between otherwise independent projects. In case of code, i think making another working copy from VCS is preferable.

    0 讨论(0)
  • 2021-01-04 05:15

    An alternative is to use your source control tool to "share" the ASCX controls between your webapps. This will allow you to make changes to the controls in either application and have the source control ensure the changes are reflected in the our webapps.

    0 讨论(0)
提交回复
热议问题