简体   繁体   English

ASP.NET-如何使用其他应用程序中的用户控件?

[英]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.

相关问题 如何从ASP.NET网站(而不是Web应用程序)中的用户控件获取父页面 - How can I get the parent page from a User Control in an ASP.NET Website (not Web Application) 如何在ASP.net中使用WPF用户控件 - How to use WPF user control in ASP.net 如何在用户控件asp.net中使用jquery对话框(弹出窗口)? - how to use jquery Dialog (popup) in user control asp.net? asp.net-如何在用户控件中从数据库加载值? - asp.net - How to load values from database in user control? 从ASP.NET调试用户控件 - Debugging a User Control from ASP.NET 如何在ASP.NET Core中定义和使用不同的用户类型 - How to Define and use Different User Types in ASP.NET Core 如何在另一个用户控件中使用asp.net用户控件? - How do I use an asp.net user control in another user control? ASP.NET:如何在ListView控件内使用UploadFile控件在Web应用程序中上传文档? - ASP.NET: How to user the UploadFile Control inside ListView Control for uploading document in the web application? 如何从我的asp.net应用程序注销用户? - how to logout the user from my asp.net application? 如何在asp.net中使用Telerik控件? - how to use telerik control in asp.net?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM