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

后端 未结 10 598
轮回少年
轮回少年 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:02

    The biggest problem I've noticed with controls in ASP.Net is that you can't easily get designer support for both building the control and using the control in a site once you built it. The only way I've been able to do that is create an .ascx control with no code-behind (ie: all the server-side code is in a script tag in the .ascx file with the runat="server" attribute).

    But even then, you still have to copy the .ascx file around, so if you ever need to make a change that means updating the file at every location where you've used it. So yeah, make sure it's in source control.

提交回复
热议问题