The Structure of an ASP.NET Page ASP.NET页面的结构(6部分)
Directives指示 <%@ .... %>两大类Page/Import
Page Directives页指示
语言指示<%@ Language="C#" %> <%@ Page Language="C#" %>
跟踪指示<%@ Trace="True" %> <%@ Page Trace="True" %>
Trace class的方法: Write() and Warn().两种方法都可输出文字,区别在于方法1是正常显示,文法2是红色显示.
示例页面 Listing 1.11 Tr***.aspx
调试指示<%@ Debug="True" %> <%@ Page Debug="True" %>
Import Directives导入指示
默认情况下,页面会自动导入了一部分命名空间,如果需要其它命名空间,必须显式的导入,如导入Sy***m.Web.Mail命名空间 <%@ Import Namespace="Sy***m.Web.Mail" %>
示例页面Listing 1.12 Im***tNamespace.aspx
Code declaration blocks 代码声明部分
代码声明区包含了页面对应的应用程序逻辑,所有的公用变量定义,子过程,函数.包含有类似
ASP.NET controls ASP.NET控制区
包含有类似
上一篇: 一种“您无权查看该网页”的原因和解决方法
下一篇: 利用WWF进行ASP.NET程序开发