Comments in HTML come in handy to temporarily remove site content. As ASP.NET developers, we have HTML comments available to use. In any ASPX markup file you can simply use the comment notation.
Unfortunately HTML comments can be seen by anyone view your site’s HTML. Additionally any runat server controls will still be executed. For those reasons HTML comments are not always a viable way to comment out portions of ASPX markup. Fortunately ASP.NET has a way to resolve both of those issues.
The ASP.NET comment takes the form of:
<%-- commented out code, or programmer remarks here --%>
ASP.NET comments, like comments in C# and other languages, are thrown away by the compiler.
ASP.NET comments prevent their content from reaching your users browser, and also prevents server controls from being compiled and executed. Often times ASP.NET comments are the best choice for comments in your ASPX markup.