ASP.NET 2.0 Server-side Comments
![]()
Ever wonder how to write comments within an aspx file? <!– Some Comment –> won’t cut it as it gets processed on the server side and the resulting HTML will contain the commented code as processed. Enter, <%– –%>. There are 2 ways you can truly comment on an aspx file.
If you prefer to type then use the <%- some comment –%> tags to enclose comments like below,
<%–
Anything within this block will not be parsed/handled by ASP.NET.
<asp:TextBox runat=”server”></asp:TextBox>
–%>
If you prefer to click then here is the visual way of doing the same,



