Is there a way to comment out markup in an .ASPX page?

后端 未结 8 1630
暗喜
暗喜 2020-12-22 18:05

Is there a way to comment out markup in an .ASPX page so that it isn\'t delivered to the client? I have tried the standard comments

相关标签:
8条回答
  • 2020-12-22 19:10
    <%--
                Commented out HTML/CODE/Markup.  Anything with
                this block will not be parsed/handled by ASP.NET.
    
                <asp:Calendar runat="server"></asp:Calendar> 
    
                <%# Eval(“SomeProperty”) %>     
    --%>
    

    Source

    0 讨论(0)
  • 2020-12-22 19:10

    While this works:

    <%-- <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="ht_tv1.Default" %> --%>
    <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="Blank._Default" %>
    

    This won't.

    <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" <%--Inherits="ht_tv1.Default"--%> Inherits="Blank._Default" %>
    

    So you can't comment out part of something which is what I want to do 99.9995% of the time.

    0 讨论(0)
提交回复
热议问题