用户控件不会显示在母版页中

时间:2017-05-10 13:43:28

标签: asp.net .net vb.net asp.net-4.0

我正在开发一个旧的ASP.NET项目应用程序。 我必须添加一个通知菜单。

为实现这一目标,我创建了一个包含以下内容的用户控件:

ComposantNotificationMenu.ascx

<%@ Control Language="vb" AutoEventWireup="false" CodeBehind="ComposantNotificationMenu.ascx.vb" Inherits="extranet.Composant.ComposantNotificationMenu" %>

<ul class="ttw-notification-menu">
    <li id="projects" class="notification-menu-item first-item">
        <a href="#">Mes derniers évènements</a>
    </li>
</ul>

ComposantNotificationMenu.vb

Namespace Composant

    Public Class ComposantNotificationMenu
        Inherits System.Web.UI.UserControl

        Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

        End Sub

    End Class

End Namespace

Extranet_PageMaitre_Base.master

<%@ Master Language="VB" CodeBehind="Extranet_PageMaitre_Base.master.vb" Inherits="extranet.Extranet_PageMaitre_Base" %>
<%@ Register TagPrefix="GeneriqueComposant" Namespace="extranet.Composant" Assembly="extranet" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
    <head id="Entete" runat="server">
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <asp:ContentPlaceHolder ID="cphEntete" runat="server" />
    </head>
    <body <%If Not Me.EstPageAccueil Then%>class="formulaires"<% end if%>>

        <div id="divComposantMenuNotification">
            <GeneriqueComposant:ComposantNotificationMenu ID="ComposantNotificationMenu" runat="server" Visible="true" />
            test
        </div>

        <asp:ContentPlaceHolder ID="cphCorps" runat="server" />
    </body>
</html>

用户控件加载事件处理,但屏幕上不显示任何内容。

我真的不知道..我已经开发了其他组件但从未在母版页中。那是问题吗?

0 个答案:

没有答案