" file.ascx"中的HTML注释表现得不像评论

时间:2015-11-09 18:25:50

标签: html asp.net comments ascx

为什么评论控件仍在搜索它的tagName ......重点是什么......我的意思是,它在评论中,它不是偶然的代码中存在。这就是注释的用途,您应该能够使编译器的代码部分不可见。它对我来说是不合理的,但事实并非如此。有人能告诉我发生了什么吗?

编辑:

我被要求显示它的评论,所以我要发布所有控件。

<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="Menu.ascx.cs" Inherits="MandatMobile.Controls.Menu"  %>


<!-- THIS MENU IS NOT OK


<div id="divi" style="float: left; position:absolute; left:-60px; top:120px;" >
    <asp:Menu ID="bootMenu" 
    runat="server" 
    Orientation="Vertical" 
    StaticDisplayLevels="1"
    StaticEnableDefaultPopOutImage="False"
    OnMenuItemClick="BootMenu_MenuItemClick" 
    MaximumDynamicDisplayLevels="10" 
    EnableViewState="false"
    CssClass="nav navbar-fix-top" 
    DynamicMenuStyle-CssClass="dropdown-menu" 
    IncludeStyleBlock="false" 
    SkipLinkText=""
    RenderingMode="List">

      <Items>
        <asp:MenuItem  Text="" ImageUrl="~/Img/Hamberger.png" ToolTip="Menu" Value="openMenu">  
       </asp:MenuItem>
    </Items>
</asp:Menu>
</div>

-->

<div id='cont' style="position:absolute;"  >

 <% if (Convert.ToInt32(Session["Level"]) == 3)
    { %>
    <input type="button" id="btnAjax" onclick="$(document).ready(function() { $('#cont').load('Controls/contentAdmin.html');});"  style="float: left; position:absolute; width:40px; height:40px; left:10px;  background-image:url(../Img/Hamberger.png);" />

<%}
  else if (Convert.ToInt32(Session["Level"]) == 2)
  { %>

   <input type="button" id="btnAjaxNormal"  onclick="$(document).ready(function() { $('#cont').load('Controls/contentNormal.html');});"  style="float: left; position:absolute; width:40px; height:40px; left:10px;  background-image:url(../Img/Hamberger.png);" />
  <% } %>

1 个答案:

答案 0 :(得分:1)

感谢Daniel Cook。使用ASP.net注释而不是HTML注释解决了这个问题。

使用:

<%--  Comments   --%>

而不是:

<!--  Comments   -->
相关问题