中国搜 程序源代码学习 编程源代码 直接应用在编程实践中 优秀编程书籍源码欣赏

收藏本页到>> 新浪ViVi  365Key网摘   IE收藏夹 |设为首页

 中国搜首页 >>ASP.NET相关>>服务器端注释<%- -%> C#版

代码说明:
     可以使用服务器端注释(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>


   运行演示程序   

  ©2004   www.zhonguosou.com