Server side comments can be added to a webpage for the documentation like others comments. We cannot see the server side comments on the web browser by using ViewSource command unlike other normal HTML comment.
Server side comment is marked with <%-- and --%> characters.
We can remove asp.net controls and other code temporarily from a page such as:
<%@ Page Language="VB" AutoEventWireup="true" CodeFile="Default.aspx.vb" Inherits= "_Default" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <script runat="server"> Dim str As String Sub Page_load() str = "Sample text" End Sub </script> <html xmlns="http://www.w3.org/1999/xhtml"> <head id="Head1" runat="server"> <title>Serverside Comments</title> </head> <body style="height: 410px; width: 768px"> <form id="Form1" runat="server"> <%-- Cooment start <asp:button ID="Button1" runat="server" text="Button" /> <%@ sometext%> End Comment --%> </form> </body> </html>