When working with an ASP.NET page or control you many want to remove code temporarily or stop some code executing while debugging. This can be achieved easily using the server-side comment opening, <%--
, and closing tag, --%>
.
The syntax is often forgotten and is very useful as you can place it around anything and the contents will be ignored:
<h1>Server-side Comments</h1> <%-- <p>Everything inside the comments tags is ignored.</p> <asp:Image runat="server"></asp:Image> <%= "Hello" %> --%>