SEA*_*SEA 2 .net html asp.net comments
我用HTML代码注释掉了我的表格.虽然表格确实被删除了,但它内部的控件似乎仍然存在.
<div>
<asp:Label ID="Label1" runat="server" Font-Bold="True" Font-Size="X-Large" ForeColor="#0066CC"></asp:Label>
<!--
<table>
<tr>
<td>
<asp:Label ID="Label1" runat="server" Font-Bold="True" Font-Size="X-Large" ForeColor="#0066CC"></asp:Label>
</td>
</tr>
</table>
-->
</div>
Run Code Online (Sandbox Code Playgroud)
当我运行我的应用程序时,visual studio给我一个错误:
ID"Label1"已被另一个rcontrol使用.
我不知道为什么visual studio仍会检查HTML注释掉部分内的控件.有没有人对此事有任何线索?提前致谢!
那是html评论,而不是asp.net服务器端评论.你应该用<% -- code --%>
<%--
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”) %>
--%>
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
220 次 |
| 最近记录: |