[英]ASP.NET - How to use a user control from a different application?
How do I utilize a user control from Application B within Application A? 如何在应用程序A中利用应用程序B中的用户控件?
Application A is a VB.NET App 应用程序A是VB.NET应用程序
Application B is a C# app. 应用程序B是C#应用程序。
This code attempts to register the control for usage in an aspx file: 这段代码尝试在aspx文件中注册要使用的控件:
<%@ Register TagPrefix="uc1" TagName="Pager" Src="../ApplicationB/Controls/PagingControl.ascx" %>
I get the following error: 我收到以下错误:
Parser Error Message: The virtual path '/ApplicationB/Controls/PagingControl.ascx' maps to another application, which is not allowed.
Can I use Application B's PagingControl.ascx within Application A? 我可以在应用程序A中使用应用程序B的PagingControl.ascx吗?
Thanks 谢谢
ASP.Net will only load binaries from either the GAC or from it's own folder structure. ASP.Net将仅从GAC或其自身的文件夹结构中加载二进制文件。 To use the control in both places you must compile it to an assembly that can be included in the bin folder for both applications.
要在两个地方都使用该控件,必须将其编译为可以包含在两个应用程序的bin文件夹中的程序集。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.