C# 如何在两个不同的模块中使用相同的用户控件

C# 如何在两个不同的模块中使用相同的用户控件,c#,vb.net,user-controls,dotnetnuke,C#,Vb.net,User Controls,Dotnetnuke,我有两个不同的模块。我正在使用dnn。我想要的是将用户控件(.ascx)从一个模块注册到不同的模块 <%@ Register Src="~/DesktopModules/DMS/DMS.PatientDiagnosis/Procedures.ascx" TagName="Procedures" TagPrefix="UC" %> 但无法在我的主模块中调用BindFunction和BindSelectedProcedures: <%@ Control Language="C#"

我有两个不同的模块。我正在使用dnn。我想要的是将用户控件(.ascx)从一个模块注册到不同的模块

<%@ Register Src="~/DesktopModules/DMS/DMS.PatientDiagnosis/Procedures.ascx" TagName="Procedures" TagPrefix="UC" %>
但无法在我的主模块中调用
BindFunction
BindSelectedProcedures

<%@ Control Language="C#" AutoEventWireup="true" CodeFile="Pers.ascx.cs" Inherits="Specialist_Pers" %>
<%@ Register src="~/DesktopModules/AgendaPlanner/AgendaPlanner.ascx" tagname="AgendaPlanner" tagprefix="uc1" %>
<uc1:AgendaPlanner ID="AgendaPlanner1" runat="server" />
我的AgendaPlanner也继承自PortalModuleBase

public partial class DesktopModules_AgendaPlanner_AgendaPlanner : PortalModuleBase
{
    public void SetAgenda()
    {
    }
}

你有编译错误吗?BindFunction/Select方法是公共的吗?@Handerks是的,它们是公共的。我没有在intellisenceCan中获取它们。你可以用UCProcedures控件显示过程代码。ascx和UCProcedures的代码隐藏吗?我试过一个例子,它似乎在更新qus时起作用。你试过从不同的模块注册用户控件吗?我试过在回答中解释它是如何工作的我有公共类PatientTechart继承PortalModuleBaseAgendPlanner.ascx这个用户控件在不同的模块中,Pers是一个模块,AgendaPlanner是另一个模块。Pers ascx将AgendaPlanner.ascx声明为usercontrol
<%@ Control Language="C#" AutoEventWireup="true" CodeFile="Pers.ascx.cs" Inherits="Specialist_Pers" %>
<%@ Register src="~/DesktopModules/AgendaPlanner/AgendaPlanner.ascx" tagname="AgendaPlanner" tagprefix="uc1" %>
<uc1:AgendaPlanner ID="AgendaPlanner1" runat="server" />
public partial class Specialist_Pers : DotNetNuke.Entities.Modules.PortalModuleBase
{
    protected void Page_Load(object sender, EventArgs e)
    {
        AgendaPlanner1.SetAgenda();
    }
}
public partial class DesktopModules_AgendaPlanner_AgendaPlanner : PortalModuleBase
{
    public void SetAgenda()
    {
    }
}