gpt4 book ai didi

c# - 如何在 asp.net 中呈现之前删除 html 注释标记

转载 作者:太空宇宙 更新时间:2023-11-03 22:23:57 24 4
gpt4 key购买 nike

我正在使用一些组件。页面渲染时,组件生成 html 评论标签。如果我在一页上使用此组件 10 次,则插入 html 注释 10 次。

如何在渲染页面前去除html注释标签?

最佳答案

使用服务器端注释:

<%--
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”) %>
--%>

或者只在 Debug模式下渲染评论

#if DEBUG
// Add my comment for debug only
#endif

关于c# - 如何在 asp.net 中呈现之前删除 html 注释标记,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2088193/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com