| 代码说明:
可以使用服务器端注释(server-side comment)块在ASP.NET页面中添加注释。服务器端的注释以<%-- 标记开始,以--%>标记结束。在调试页面时,服务器端的注释也是很有用的。可以使用服务器端注释临时性的将ASP.NET控件和代码呈现块从页面中去除。
下面的代码演示了这种用法:
<Script Runat="Server">
Dim strSomeText As String
Sub Page_Load
strSomeText = "Hello!"
End Sub
</Script>
<html>
<head><title>ServerComments.aspx</title></head>
<body>
<form Runat="Server">
<%--
This is inside the comments
<asp:Label Text="hello!" Runat="Server" />
<%= strSomeText %>
--%>
This is outside the comments
</form>
</body>
</html>
|