小新的技术天地

Make It Works !

博客园 首页 新随笔 联系 订阅 管理

1.ASP.NET work process是IIS进程(inetinfo.exe)中分离出来的一个单独进程,叫aspnet_wp.exe(IIS5,在IIS6中有所不同,如不过不是以IIS5隔离模式运行的话,则asp.net驻留在w3wp.exe进程中)
2.跟ASP的不同点,脚本语言不局限于vbscript根javascript,而是所有.net支持的语言,更重要的一点区别是由原来的解释模式改变成编译模式,好处就不说了。
3.我们每一个asp.net页面都是一个类型,继承自Page类(可以通过this.GetType(),this.GetType().BaseType进行验证),祖先类Page提供了一些很有用的成员。
4.使用代码隐藏技术改善了原来asp中html编码跟脚本混合编辑的方式,当然我们还可以用原来的方式书写脚本,但是更好的方式是写在一个单独的代码文件中,通过page的scr属性进行引用,如
<%@ Page language="c#" src="CodeBehind.cs" AutoEventWireup="false" Inherits="XXin.WebForm" %>
不过我们可以查看到vs.net2003自动生成的是
<%@ Page language="c#"  CodeBehind="CodeBehind.cs" AutoEventWireup="false" Inherits="XXin.WebForm" %>
实际上CodeBehind是不存在的,是专属于VS的,Page会忽略这个属性,那时如何运作呢,VS会编译CodeBehind指向的文件,生成程序集于bin目录下,那么aspx会去程序集中查找<%@ Page language="c#" Codebehind="WebForm1.aspx.cs" AutoEventWireup="false" Inherits="WebApplication4.WebForm1" %>XXin.WebForm这个类的定义。
<%@ Page language="c#" Codebehind="WebForm1.aspx.cs" AutoEventWireup="false" Inherits="WebApplication4.WebForm1" %>
<%@ Page language="c#" Codebehind="WebForm1.aspx.cs" AutoEventWireup="false" Inherits="WebApplication4.WebForm1" %><%@ Page language="c#" Codebehind="WebForm1.aspx.cs" AutoEventWireup="false" Inherits="WebApplication4.WebForm1" %><%@ Page language="c#" Codebehind="WebForm1.aspx.cs" AutoEventWireup="false" Inherits="WebApplication4.WebForm1" %><%@ Page language="c#" Codebehind="WebForm1.aspx.cs" AutoEventWireup="false" Inherits="WebApplication4.WebForm1" %>

posted on 2006-04-09 16:09  小新0574  阅读(675)  评论(0编辑  收藏  举报