这里只是开个头,如果大家有别的体会就麻烦也跟一下吧!

1。2005中会自动的添加代码以遵循XHTML标准了。

一个新建的页面在2003中的原始代码(前一部分)

<%@ Page language="c#" Codebehind="WebForm1.aspx.cs" AutoEventWireup="false" Inherits="vcLoveCity.WebForm1" %>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<HTML>
    
<HEAD>
        
<title>WebForm1</title>
        
<meta name="GENERATOR" Content="Microsoft Visual Studio .NET 7.1">
        
<meta name="CODE_LANGUAGE" Content="C#">
        
<meta name="vs_defaultClientScript" content="JavaScript">
        
<meta name="vs_targetSchema" content="http://schemas.microsoft.com/intellisense/ie5">
    
</HEAD>
    
<body>

而在2005中呢?
<%@ Page Language="C#" CompileWith="Default2.aspx.cs" ClassName="Default2_aspx" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    
<title>Untitled Page</title>
</head>
<body>
    
<form id="form1" runat="server">

清晰可见了,2003中支持HTML 4.0而2005中却是XHTML 1.1了,而且也没有了HTML HEAD这样大写的情况了。

2。没有了烦人的<FONT id="FONT1" face="宋体">了。

3。编译器排错的功能更强了。

看一段代码:<%@ OutPutCache Duration="60 VaryByParam="none"%>
很明显,少了一个“才对的,但是在2003下编译是通过的,只有到了页面才会提示你有错误:

Parser Error Message: The 'duration' attribute must be set to a positive integer value

但是在2005中,编译的时候都通不过了:
Build (web): The 'duration' attribute must be set to a positive integer value.

Can not switch: If this attribute value is quoted, the quotes must match.

看来2005的智能感知不之是everywhere,排错也几乎是everywhere了。

#顺便提一点别的 #
对于IsPostBack,MSDN中是这样说的:
Gets a value indicating whether the page is being loaded in response to a client postback, or if it is being loaded and accessed for the first time.
中文意思就是说 获取一个值,该值指示该页是否正为响应客户端回发而加载,或者它是否正被首次加载和访问。

但是在其代码中有这样的注释:
 

[C#] void Page_Load() {
if (!IsPostBack) {
// Validate initially to force asterisks
// to appear before the first roundtrip.

Validate();
}

}


谁能详细的解释一下这句话? roundtrip ? asterisks(星号) ? 怎么理解呢 ?

posted on 2005-01-08 20:45  维生素C.NET  阅读(1191)  评论(5)    收藏  举报