^_^ 的个人资料zippo,dream,real,distanc...照片日志列表 工具 帮助

日志


3月29日

ASP.NET and the .NET Framework

 

ASP.NET is part of Microsoft's overall .NET framework, which contains a vast set of programming classes designed to satisfy any conceivable programming need. In the following two sections, you learn how ASP.NET fits within the .NET framework, and you learn about the languages you can use in your ASP.NET pages.

ASP.NET是微软.NET框架总体战略的一部分。它包含了一组满足各种可以想象到的需求的类。在之后的两个部分,你将会学到ASP.NET是怎样融合到.NET框架中去的,而且你将会学到可以在ASP.NET页面中使用到的语言。

The .NET Framework Class Library

.NET框架类库

Imagine that you are Microsoft. Imagine that you have to support multiple programming languages—such as Visual Basic, JScript, and C++. A great deal of the functionality of these programming languages overlaps. For example, for each language, you would have to include methods for accessing the file system, working with databases, and manipulating strings.

假设你就是微软,假设你必须支持多语言编程,例如VB,JS,C++。这些语言的很多函数都重复了,比如对于每种语言,你都必须包含一些访问文件系统,与数据库打交道,以及处理字符串的函数。

Furthermore, these languages contain similar programming constructs. Every language, for example, can represent loops and conditionals. Even though the syntax of a conditional written in Visual Basic differs from the syntax of a conditional written in C++, the programming function is the same.

而且这些语言都包含了相似的变成结构。每种语言都有循环和条件语句。虽然条件语句的语法有些出入,但是功能还是一样的。

Finally, most programming languages have similar variable data types. In most languages, you have some means of representing strings and integers, for example. The maximum and minimum size of an integer might depend on the language, but the basic data type is the same.

最后,很多变成语言都有相似的变量类型定义。在很多语言中,你都可以表达出字符串类型和整型。整型数的最大和最小值则由语言本身决定,但基本的表量类型还是相同的。

Maintaining all this functionality for multiple languages requires a lot of work. Why keep reinventing the wheel? Wouldn't it be easier to create all this functionality once and use it for every language?

维护所有这些语言的函数会很费事。干吗要不断的重复历史的车轮?如果只对函数建立一次而后对每种语言都使用是否会更爽些?

The .NET Framework Class Library does exactly that. It consists of a vast set of classes designed to satisfy any conceivable programming need. For example, the .NET framework contains classes for handling database access, working with the file system, manipulating text, and generating graphics. In addition, it contains more specialized classes for performing tasks such as working with regular expressions and handling network protocols.

而.net框架类库正是如此,它包含了一组为满足变成需要而设计的类。举例来说,.net框架包含了处理数据库访问的一组类。同时还有文件系统处理类以及视图产生类。而且,他包含了更多的较为细化的用来处理正则表达式和网络协议的类。

 

The .NET framework, furthermore, contains classes that represent all the basic variable data types such as strings, integers, bytes, characters, and arrays.

更重要的是,.net框架还将所有一些基础变量都表示了出来,例如字符串类型,整型,字符型和数组。

Most importantly, for purposes of this book, the .NET Framework Class Library contains classes for building ASP.NET pages. You need to understand, however, that you can access any of the .NET framework classes when you are building your ASP.NET pages.

最重要的也是本书的主要目的,.net框架类库包含了用来建立asp.net页面的类。你需要明白的是,你可以在建立自己的asp.net页面的时候访问任何一个.net框架中的类。

Understanding Namespaces

搞懂命名空间

As you might guess, the .NET framework is huge. It contains thousands of classes (over 3,400). Fortunately, the classes are not simply jumbled together. The classes of the .NET framework are organized into a hierarchy of namespaces.

ASP Classic Note

正如你所想的,.net框架很庞大。他包含了数以千计的类。还好的是,这些类不是杂乱的拼在一起的。.net框架中的这些类是按照命名空间的各个层次组织在一起的。

In previous versions of Active Server Pages, you had access to only five standard classes (the Response, Request, Session, Application, and Server objects). ASP.NET, in contrast, provides you with access to over 3,400 classes!

在asp过去的版本中,你仅仅可以访问五个标准类。想必来说,asp.net则为你提供了多达3400个类。


A namespace is a logical grouping of classes. For example, all the classes that relate to working with the file system are gathered together into the System.IO namespace.

命名空间就是对类进行逻辑上的划分。比如,所有和文件系统相关的类都被放入system.io的命名空间中。

The namespaces are organized into a hierarchy (a logical tree). At the root of the tree is the System namespace. This namespace contains all the classes for the base data types, such as strings and arrays. It also contains classes for working with random numbers and dates and times.

同时,命名空间也被组织为一个逻辑上的分层。在这个逻辑分层的最根部是system命名空间。这个命名空间包含了所有与基础数据类型相关的类,比如字符串和数组。同时他还包含了处理随机数和日期时间的类。

You can uniquely identify any class in the .NET framework by using the full namespace of the class. For example, to uniquely refer to the class that represents a file system file (the File class), you would use the following:

System.IO.File

通过使用类的全称,你可以唯一的定位任何一个类。比如定为一个表示文件系统的file类,你可以使用以下的命名:System.IO.File

System.IO refers to the namespace, and File refers to the particular class.

System.IO表示命名空间,而File表示这个特殊的类。

NOTE

You can view all the namespaces of the standard classes in the .NET Framework Class Library by viewing the Reference Documentation for the .NET Framework.

如果想要浏览在.net框架类库中的所有的关于标准类的命名空间,你可以通过浏览参考文档。

Standard ASP.NET Namespaces

asp.net标准命名空间

The classes contained in a select number of namespaces are available in your ASP.NET pages by default. (You must explicitly import other namespaces.) These default namespaces contain classes that you use most often in your ASP.NET applications:

部分命名空间中包含的一些类是默认可以使用的,但有些命名空间则必须明确的引用进来。这些默认的命名空间包含了你最常使用的一些类。

 

  • System— Contains all the base data types and other useful classes such as those related to generating random numbers and working with dates and times.

  • System--包含了所有基础类型和其他一些有用的类,例如涉及到产生随机数以及和时间和日期相关的类。

  • System.Collections— Contains classes for working with standard collection types such as hash tables, and array lists.

  • System.Collections--包含了一些例如hash表和数组列表这些标准集合类型的类。

  • System.Collections.Specialized— Contains classes that represent specialized collections such as linked lists and string collections.

  • System.Collections.Specialized--包含一些表示比较特殊的集合,比如链表和字符串集合。

  • System.Configuration— Contains classes for working with configuration files (Web.config files).

  • System.Configuration--包含了处理配置文件的一些类。

  • System.Text— Contains classes for encoding, decoding, and manipulating the contents of strings.

  • System.Text--包含了一些涉及到编码,解码以及处理字符串内容的类。

  • System.Text.RegularExpressions— Contains classes for performing regular expression match and replace operations.

  • System.Text.RegularExpressions--包含了进行正则表达式匹配及替换的操作的类。

  • System.Web— Contains the basic classes for working with the World Wide Web, including classes for representing browser requests and server responses.

  • System.Web--包含了处理网络方面的一些基本的类,包括表示浏览器请求及服务端应答的类。

  • System.Web.Caching— Contains classes used for caching the content of pages and classes for performing custom caching operations.

  • System.Web.Caching--包含了一些用来缓存页面和类的内容以用来做一些常规的缓存操作的类。

  • System.Web.Security— Contains classes for implementing authentication and authorization such as Forms and Passport authentication.

  • System.Web.Security--包含了一些执行鉴定和授权的类,例如Forms和Passport鉴定。

  • System.Web.SessionState— Contains classes for implementing session state.

  • System.Web.SessionState--包含了处理session的状态的一些类。

  • System.Web.UI— Contains the basic classes used in building the user interface of ASP.NET pages.

  • System.Web.UI--包含了用来建立ASP.NET页面的用户接口的基本类。

  • System.Web.UI.HTMLControls— Contains the classes for the HTML controls.

  • System.Web.UI.WebControls— Contains the classes for the Web controls.

.NET Framework-Compatible Languages

For purposes of this book, you will write the application logic for your ASP.NET pages using Visual Basic as your programming language. It is the default language for ASP.NET pages (and the most popular programming language in the world). Although you stick to Visual Basic in this book, you also need to understand that you can create ASP.NET pages by using any language that supports the .NET Common Language Runtime. Out of the box, this includes C# (pronounced See Sharp), JScript.NET (the .NET version of JavaScript), and the Managed Extensions to C++.

NOTE

The CD included with this book contains C# versions of all the code samples.


Dozens of other languages created by companies other than Microsoft have been developed to work with the .NET framework. Some examples of these other languages include Python, SmallTalk, Eiffel, and COBOL. This means that you could, if you really wanted to, write ASP.NET pages using COBOL.

Regardless of the language that you use to develop your ASP.NET pages, you need to understand that ASP.NET pages are compiled before they are executed. This means that ASP.NET pages can execute very quickly.

The first time you request an ASP.NET page, the page is compiled into a .NET class, and the resulting class file is saved beneath a special directory on your server named Temporary ASP.NET Files. For each and every ASP.NET page, a corresponding class file appears in the Temporary ASP.NET Files directory. Whenever you request the same ASP.NET page in the future, the corresponding class file is executed.

When an ASP.NET page is compiled, it is not compiled directly into machine code. Instead, it is compiled into an intermediate-level language called Microsoft Intermediate Language (MSIL). All .NET-compatible languages are compiled into this intermediate language.

An ASP.NET page isn't compiled into native machine code until it is actually requested by a browser. At that point, the class file contained in the Temporary ASP.NET Files directory is compiled with the .NET framework Just in Time (JIT) compiler and executed.

The magical aspect of this whole process is that it happens automatically in the background. All you have to do is create a text file with the source code for your ASP.NET page, and the .NET framework handles all the hard work of converting it into compiled code for you.

ASP CLASSIC NOTE

What about VBScript? Before ASP.NET, VBScript was the most popular language for developing Active Server Pages.

ASP.NET does not support VBScript, and this is good news. Visual Basic is a superset of VBScript, which means that Visual Basic has all the functionality of VBScript and more. So, you have a richer set of functions and statements with Visual Basic.

Furthermore, unlike VBScript, Visual Basic is a compiled language. This means that if you use Visual Basic to rewrite the same code that you wrote with VBScript, you can get better performance.

If you have worked only with VBScript and not Visual Basic in the past, don't worry. Since VBScript is so closely related to Visual Basic, you'll find it easy to make the transition between the two languages.


NOTE

Microsoft includes an interesting tool named the IL Disassembler (ILDASM) with the .NET framework. You can use this tool to view the disassembled code for any of the ASP.NET classes in the Temporary ASP.NET Files directory. It lists all the methods and properties of the class and enables you to view the intermediate-level code.

This tool also works with all the ASP.NET controls discussed in this chapter. For example, you can use the IL Disassembler to view the intermediate-level code for the TextBox control (located in a file named System.Web.dll).


3月27日

Part I: Working with ASP.NET Web Forms

Chapter 1. Building ASP.NET Pages
 

In this chapter, you learn how to build basic ASP.NET Web Forms Pages. Don't let the Forms part of the name mislead you. Web Forms Pages can do much more than display standard HTML forms. Most, if not all, of the pages of your ASP.NET application will be Web Forms Pages, which enable you to create pages with interactive, dynamic, or database-driven content.

在这一章节,你将学到怎样建立一个基本的ASP.NET Web Forms Pages.不要被名字中的Forms误导了你。Web Forms Pages 可以做比仅仅显示一个普通的HTML更多的事情。在你的ASP.NET中将会多数都是Web Forms Pages,而这些将会使你创建交互的,动态的或者基于数据库内容的页面。

Web Forms Pages are pieced together out of two building blocks. First, you assemble the dynamic portion of the user interface by using ASP.NET controls. ASP.NET controls enable you to display "smart" HTML forms, for example, and present interactive grids of database data. The first part of this chapter provides an overview of all the ASP.NET controls.

Web Forms Pages 被分割为两个构造的模块。首先,你将利用ASP.NET控件把用户界面的各个动态部分集合起来。ASP.NET能使你展示出精巧的HTML表格,也可以让你做出交互的数据库数据表格。此节的第一部分为你提供了关于ASP.NET空间的概况。

The second building block of a Web Forms Page is the application logic, which includes the code that executes when you click a form button, or the code that retrieves the database data displayed within a control. In the second part of this chapter, you learn how to add application logic to your Web Forms Pages to handle both control and page events.

第而部分是应用的程序的逻辑,主要包括了按钮触发事件的代码或者查询数据库数据并在控件中展示的代码。第二部分中,你将学会怎样向Web Forms Pages插入应用程序的逻辑来处理控件和页面事件。

Finally, in the last part of this chapter, you are formally introduced to the structure of an ASP.NET Web Forms Page. You learn about the different sections of a Web Forms Page and the type of content appropriate to each section.

最后,本章节的最后一部分,你将了解到一个Web Forms Pages的结构。你将了解到一个Web Forms Pages的各个部分以及各个部分之间的类似之处。

After reading this chapter, you can start creating dynamic Web sites by building interactive, dynamic pages using ASP.NET controls and handling control and page events with application logic.

完成此节的学习之后,你将能够通过使用ASP.NET控件及利用应用逻辑来处理控件和页面事件构件交互动态的页面开始创建动态的网站

Conventions Used in This Book

The following typographic conventions are used in this book:

以下这些印刷体的命名规则将在本书中被使用:

  • Code lines, commands, statements, variables, and any text you type or see onscreen appears in a mono typeface. Bold mono typeface is often used to represent the user's input.

  • 代码行,命令,声明,变量和所有你在屏幕上看到或输入的文本都是以单一字体出现的,而加黑的字体用来标示用户的输入信息。

  • Placeholders in syntax descriptions appear in an italic mono typeface. Replace the placeholder with the actual filename, parameter, or whatever element it represents.

  • 在语法描述中的占位符将以italic mono 的字体形式出现。用实际的文件名,参数名或者任何这些占位符代表的元素来代替这些占位符。

  • Italics highlight technical terms when they're being defined.

  • 当一些技术名次被定义的时候,这些词会被以高显得形式标注出来。

  • The  icon is used before a line of code that is really a continuation of the preceding line. Sometimes a line of code is too long to fit as a single line on the page. If you see graphics/ccc.gif before a line of code, remember that it's part of the line immediately above it.

  •  

  • The book also contains Notes, Tips, and Cautions to help you spot important or useful information more quickly.

  • The notes include comments for experienced ASP users who are upgrading to ASP.NET. These notes are labeled "ASP Classic Note."

3月9日

Code Naming Conventions Used in This Book

The topic of variable naming and code conventions is a touchy one. Programmers tend to develop their personal naming conventions and don't like others dictating how they should write their code.

变量命名规则和编码规范一直是一个比较敏感的话题。程序员更倾向于有自己的编程命名规则,他们不喜欢别人告诉他们应该怎么写自己的代码。

Nevertheless, having a common convention is valuable when code must be read by multiple people in an organization (think code reviews). Having a common convention also makes it easier to read your own code if you return to it at a later date.

不管怎样,如果会有比较多的人来阅读代码,有一个共同的编程规范更有利些(比如代码审查)。有一个共同的约定能让你在隔一段时间以后再阅读自己的代码的时候,能够很容易读懂。

The most popular variable naming convention is called Hungarian Notation. It was originally developed by Charles Simonyi at Microsoft and has been used internally at Microsoft for a number of years. According to this convention, you should name all variables starting with a standard three or four letter prefix that represents the variable's data type. For example, an integer variable used to represent a customer's age should be named intCustomerAge.

最流行的命名规范是匈牙利符号。它最初是由在微软的Charles Simonyi开发的,并且在微软内部已使用了多年。根据这个规则,你必须在命名所有变量的时候都在变量前加上三到四个字符以标示变量的数据类型。比如,一个用来表示客户年龄的变量应该命名为intCustomerAge。

Microsoft recommends that you do not follow this convention in the case of the .NET Framework and ASP.NET. The motivation for this recommendation is that they expect you to use an advanced editor, such as Microsoft Visual Studio, to write your code. Visual Studio automatically provides you with information about a variable's type.

但微软建议,如果开发.NET Framework and ASP.NET,不要使用这样的规则。这样建议的动机是他们希望在你开发的时候你可以使用一个比较高级的编辑器,比如Microsoft Visual Studio。Visual Studio能够自动为你通过一个变量的相关信息。

However, in this book, I will not assume that you are using Visual Studio to write your ASP.NET pages. In practice, developers use a wide variety of editors—such as Web Matrix, TextPad, UltraEdit, and Notepad—to write code. Since I am not assuming that you are using Visual Studio, a variable naming convention is necessary.

然而在这本书中,我将架设你并没有使用Visual Studio来编写你的ASP.NET页面。在实际中,开发人员有可能使用各种各样的编辑器,比如Web Matrix, TextPad, UltraEdit, and Notepad。正因为这样,我才觉得变量命名规则是必须的。

Furthermore, in my experience, many companies require their programmers to follow a strict naming convention that is typically some variation on the Hungarian Notation. I'll be using a variation of Hungarian Notation for the naming conventions used in this book. I've created a set of prefixes and naming conventions for the basic variable data types, ASP.NET Web Controls, ADO.NET classes, and event-handling subroutines. These conventions are listed in the following tables.

而且以我的经验来看,很多公司要求他们遵循一个比较严格的命名规范,而这些命名规范很多是匈牙利符号的一个变形。在本书中我也会使用这样一种命名规则。我已经为一些基本变量类型,ASP.NET web控件, ADO.NET 类和 事件处理子程序建立了一组前缀及命名规则。

My goal is not to provide a standard prefix for each and every class in the .NET Framework. That would require over 3,400 standard prefixes! The goal is to provide standard prefixes for the most common types that you would use in ASP.NET.

Table . Variable Naming Conventions

Type

Prefix

Example

Array

arr

arrShoppingList

Boolean

bln

blnIsPostBack

Byte

byt

bytPixelValue

Char

chr

chrDelimiter

DateTime

dtm

dtmStartDate

Decimal

dec

decAverageHeight

Double

dbl

dblSizeOfUniverse

Integer

int

intRowCounter

Long

lng

lngBillGatesIncome

Object

obj

objReturnValue

Short

shr

shrAverage

Single

sng

sngMaximum

String

str

strFirstName

Table . WebControls

Type

Prefix

Example

AdRotator

adrt

adrtTopAd

Button

btn

btnSubmit

Calendar

cal

calMeetingDates

CheckBox

chk

chkBlue

CheckBoxList

chkl

chklFavColors

CompareValidator

valc

valcValidAge

CustomValidator

valx

valxDBCheck

DataGrid

dgrd

dgrdTitles

DataList

dlst

dlstTitles

DropDownList

drop

dropCountries

HyperLink

lnk

lnkDetails

Image

img

imgAuntBetty

ImageButton

ibtn

ibtnSubmit

Label

lbl

lblResults

LinkButton

lbtn

lbtnSubmit

ListBox

lst

lstCountries

Panel

pnl

pnlForm2

PlaceHolder

plh

plhFormContents

RadioButton

rad

radFemale

RadioButtonList

radl

radlGender

RangeValidator

valg

valgAge

RegularExpression

vale

valeEmail_Validator

Repeater

rpt

rptQueryResults

RequiredFieldValidator

valr

valrFirstName

Table

tbl

tblCountryCodes

TableCell

tblc

tblcGermany

TableRow

tblr

tblrCountry

TextBox

txt

txtFirstName

ValidationSummary

vals

valsFormErrors

XML

xmlc

xmlcTransformResults

Table . ADO.NET

Type

Prefix

Example

Connection

con

conNorthwind

Commmand

cmd

cmdReturnProducts

Parameter

parm

parmProductID

DataAdapter

dad

dadProducts

DataReader

dtr

dtrProducts

DataSet

dst

dstNorthwind

DataTable

dtbl

dtblProduct

DataRow

drow

drowRow98

DataColumn

dcol

dcolProductID

DataRelation

drel

drelMasterDetail

DataView

dvw

dvwFilteredProducts

Event-Handling Subroutines

The name of an event-handling subroutine will consist of the ID of the control that raised the event followed by the type of event being handled. For example, a subroutine named btnSubmit_Click handles the Click event of a Button control named btnSubmit.

事件处理子程序的名字由触发此事件的控件ID和被处理事件的类型组成。举例来说,一个叫做btnSubmit_Click的事件则是处理一个名叫btnSubmit的按钮的单击事件的。

When a control that raises an event is not assigned an ID, the type of the control is used instead of the ID. For example, the subroutine named Button_Click handles the Click event of a Button control without an ID.

当一个没有任何ID的控件触发一个事件时,控件类型将取代ID在命名中出现。Button_Click则是处理一个无ID的按钮的单击事件。

3月8日

How This Book Is Organized

  Although I encourage you to read this book from start to finish, reading chapter by chapter, I realize that not everyone has time to do so. If necessary, you can use this book solely as a reference and jump to a chapter only when the need arises. It might be helpful, therefore, to have an idea of the overall organization of this book.

  尽管我建议你把这本书从头到尾都读完,但我意识到不是谁都有足够的时间。如果必要的话,你可以仅仅把它当作一本参考资料来看,仅在需要的时候跳到相应的章节。所以了解到这个文章的结构对你还是有些帮助的。

  • Part I: Working with ASP.NET Web Forms— The chapters in this part provide you with detailed information on building ASP.NET pages with form and validation controls. All the controls used for constructing interactive HTML forms are discussed.

  • 第一部分:用ASP.NET Web Forms开发---本部分的几个章节提供了一些详细的信息教你使用框架(?)和验证控件构建ASP.NET页面。所有关于构建交互性HTML界面的控件都将会被介绍。

  • Part II: Advanced ASP.NET Page Development— These chapters discuss how to create your own controls with user controls, how to use mobile controls to create Web pages that work with cell phones and personal digital assistants (PDAs), how to divide the code from the design content on a page, and how to use third-party controls in your ASP.NET pages.

  • 第二部分:ASP.NET Page高级开发---这些章节讨论了怎么样利用用户控件来创建你自己的控件,怎样利用 mobile controls 来创建web页面来支持手机及PDA,怎样将页面的代码及设计分开,怎样在你的ASP.NET页面上使用第三方控件。

  • Part III: Working with ADO.NET— The chapters in this part provide you with a detailed understanding of ADO.NET. You learn how to perform basic database tasks, such as saving form data to a database. You also learn how to use the specialized database Web controls, such as the DataList and DataGrid controls.

  • 第三部分:使用ADO.NET---这些章节能够让你详细的了解ADO.NET。你可以从中学到对于数据库的一些基本操作,比如保存一份表格到数据库中去。你同样会学到怎样使用特殊化的数据库web控件,比如DataList和DataList控件。

  • Part IV: Working with ASP.NET Applications— These chapters discuss features of an ASP.NET application. For example, you learn how to configure your ASP.NET application with the Web.config file and work with both application and session state.

  • 第四部分(四是这样写的IV):使用ASP.NET应用程序---这些章节讨论了一个ASP.NET应用程序所具有的特点。举个例子,你将学会怎样使用Web.config文件来控制你的ASP.NET应用程序,也会学到怎样同时使用应用程序和session状态(高手帮忙,这里怎么翻)。

  • Part V: Securing ASP.NET Applications— These chapters provide you with an overview of the security features built into ASP.NET. For example, you learn how to use form-based security to password-protect pages on your site. You also learn how to use the .NET classes for performing encryption.

  • 第五部分:保证ASP.NET应用程序的安全---这些章节为你提供了一个概况,使你能够了解到构建到ASP.NET程序内部的安全方面的新特点。比如你可以学到在你的站点上怎样使用基于表格形式的安全措施来对密码进行保护。同时你可以学到使用.NET里的类来进行加密操作。

  • Part VI: Building ASP.NET Web Services— The chapters in this part explain how to use an exciting new technology included with this release of Active Server Pages. In these chapters, you learn how to create Web Services and integrate the Web Services into your Web site.

  • 第六部分:构建 ASP.NET的Web服务---这些章节将介绍怎样使用在这一版本中新添的技术(并不怎么激动人心)。在这些章节中,你将了解到怎样创建Web服务并且将这些服务集成到你的web站点上。

  • Part VII: Leveraging the .NET Framework— These chapters discuss many of the useful .NET classes that you can use in your pages. For example, you learn how to generate images on-the-fly, work with collections and regular expressions, and send e-mail from an ASP.NET page.

  • 第七部分:(这个leveraging到底怎么翻译才好)---这些章节讨论了很多可以用在你的页面中的比较有用的.NET类。比如你可以生成动态(on-the-fly)图片,可以使用集合和正则表达式,并且可以直接从界面中发送邮件。

  • Part VIII: Building Custom ASP.NET Controls— These chapters discuss how you can extend the ASP.NET Framework with custom controls. You learn how to create your own ASP.NET controls.

  • 第八部分:构建定制的ASP.NET控件---这里介绍了怎样使用定制控件来丰富你的ASP.NET 框架。

  • Part IX: Sample ASP.NET Applications— The final part of this book contains two complete sample applications. You learn how to build a job site and an online store.

  • 第九部分:ASP.NET的应用程序案例---最后一部分包含了俩个完整的应用程序例子,包括工作网站和网上书店。

3月3日

Introduction

Introduction

简介

ASP.NET 1.1, the latest version of Active Server Pages, is Microsoft's technology for building dynamic, database-driven Web sites.

ASP.NET 1.1是Active Server Pages的最新版本,它是微软开发的,用来构建动态的,数据库驱动的网站的一项技术。

ASP.NET is one of the most popular languages for building scalable, interactive Web sites. Several of the highest traffic Web sites on the Internet employ ASP.NET. Prominent examples include The Home Shopping Network, MSN, and the Microsoft site itself.

ASP.NET是几种比较流行的用于构造可扩展的,交互性强的网站的编成语言之一。

ASP.NET represents a radical departure from previous versions of Active Server Pages. If you have programmed with earlier versions of Active Server Pages and you have not been exposed to the new features of ASP.NET, prepare to be shocked.

ASP.NET相对asp之前几个版本变化很大,如果你之前用过asp其他版本编写过程序而且还有没接触到ASP.NET的新特征,做好心理准备。(屁,我就没准备,也好好的)。

Following are some of the significant new features of ASP.NET:

ASP.NET比较突出的新特征主要体现如下:

  • ASP.NET uses compiled code written in Common Language Runtime languages such as Visual Basic and C#. Unlike previous versions of Active Server Pages, this version does not use interpreted scripting languages such as VBScript.

  • ASP.NET使用已编译过的像Visual Basic and C#这样的以公共语言运行库为基础的代码。而并不像之前几个版本一样,它不再使用诸如VBScript这样的中间脚本语言。(还不怎么很懂,请高手指点

  • ASP.NET pages are built out of server-side controls. Web server controls enable you to represent and program against Hypertext Markup Language (HTML) elements using an intuitive object model.(不会翻译,郁闷!)

  • ASP.NET includes a new technology called Web Services. You can use Web Services to access methods and properties and transfer database data across the Internet.

  • ASP.NET 有一项技术被称做网络服务。你可以利用这项技术来通过互联网访问其他主机上的方法或属性,还可以传输数据库数据。

  • ASP.NET is part of Microsoft's .NET Framework. You can access thousands of .NET classes in your code that enable you to perform such wondrously diverse tasks as generating images on-the-fly and saving an array to a file.

  • ASP.NET是Microsoft's .NET Framework的一部分,你可以在你的代码中访问数以千计的.NET类,以便你实现类似产生即时图片或者保存一列数组到文件等各项功能。

  • ASP.NET includes page and data caching mechanisms that enable you to easily and dramatically improve the performance of your Web site.

  • ASP.NET提供了页面和数据的高速缓存机制,这个机制使你很容易并且能够极大的提高你的网站的性能。

About the Author

About the Author

Stephen Walther a well-known ASP.NET expert and trainer, has provided training to companies and organizations throughout the United States including NASA, Verizon, MetLife, and the National Science Foundation through his company Superexpert AspWorkshops (www.AspWorkshops.com). He was the lead developer of the ASP.NET Community Starter Kit, a "best-practices" application released by Microsoft. Stephen was the past Chief Technical Officer of CityAuction (www.cityauction.com), one of the Internet's top person-to-person auction Web sites, and the exclusive auction provider for both Snap! and CitySearch. Stephen was also past Chief Technical Officer of Collegescape, the leading provider of online college applications.

 

关于作者

   Stephen Walther 在ASP。NET方面是一个知名的专家和培训者。通过他的公司,他向全美国各个地方的公司和机构提供培训课程。他曾经是微软发布的一款软件---ASP.NET Community Starter Kit的首席开发工程师。他还是一家从事私人交易的网站的技术总监,同时,他也曾经是Collegescape,一家提供网上大学教程的公司的技术总监。

3月1日

asp.net揭秘 第二版

   The second edition of ASP.NET Unleashed further strengthens a book that is already one of the most highly regarded ASP.NET books available. Stephen covers virtually all relevant features of ASP.NET. In addition, all samples will now be presented in VB .NET and C#.

   Throughout the more than 1,400 pages readers are shown how to develop state-of-the-art Web applications using Microsoft's powerful ASP.NET. It progresses through Web Forms basics, advanced page development, ADO.NET and XML, securing Web applications, XML Web Services, leveraging the .NET Framework, building custom controls and powerful sample applications. This is a resource that will be referenced over and over.

   此书为asp.net揭秘 第二版,它的第一版在现有的关于asp.net的书中评价极高,而这一版对第一版做了进一步的加强与改进。作者几乎在书中包含了所有与asp.net相关的特征。而所有的例子都在书中以vb和c#两种语言表示出来了。

   本书通过这1400多页的内容向读者展示了如何利用微软强大的开发工具开发出艺术级的Web应用程序。文章涉及了web格式(?)基础,高级页面开发,ADO.NET和XML,Web应用程序安全,XML Web服务,.NET协调(?),传统控件和功能强大的例子程序的构建。这是一个将会不断被引用到的资源。

  

  

2月28日

ASP.net程序员案头经典参考学习书籍汇总 <转贴>

ASP.net程序员案头经典参考学习书籍汇总
现在书店/网络上介绍Asp.net的书籍林林种种,良莠不齐.下面这几本书,算是Asp.net程序员案头上比较经典的一部分.当然,经典的并不只是这么几本书,就当是抛砖引玉吧,希望大家能继续推荐更多更好的学习/参考书籍. 

下面这些书籍的电子版,有一部分已经在论坛的ftp里面了.希望对大家有一定的帮助...我也是.net初学者,也希望我能在这个论坛向大家学习到更多的东西...;) 

1) 
Microsoft .NET框架程序设计(修订版) 
 Applied Microsoft .NET Framework Programming  
作者:[美] Jeffrey Richter 
译者:李建忠 
出版社:清华大学出版社 

本任何一个想了解.NET、学习.NET的读者都不可不读的开山之作。它全面剖析了.NET框架机理,深度阐述了.NET平台思想。中文版翻译请完全放心,和很多翻译的技术类书籍相比,这个应该是少有的佳作. 

2) 
ASP.NET揭秘(第二版) 
 ASP.NET UNLEASHED Second Edition  
 作者:[美]Stephen Walther 
译者:汤涛 
出版社:中国电力出版社 

本书是美国亚马逊网站同类书长期销售冠军,并受到微软ASP.NET小组项目经理Rob Howard的大力推荐,中文版由中科院专家汤涛老师翻译,经典、权威是本书最好的诠释。第二版的原书采用vb.net,但是其C#版本的源码在随书光盘里面能找到. 

3) 
ASP.NET Web站点高级编程—提出问题-设计方案-解决方案 
 ASP.NET Website Programming:Problem-Design-Solution  
作者:Marco Bellinaso,Kevin Hoffman 
译者:康博/译(vb.net语言版本为杨浩/译) 
出版社:清华大学出版社 
原出版社: Wrox Press 

本书通过开发一个完整实用的Web站点的开发实例,系统全面地介绍了ASP.NET Web站点开发技术。全书共分12章,各章的内容介绍遵循提出问题、设计方案和解决方案的顺序。 
网上很多人对康博的翻译水平一直质疑,不过这本书还是翻译的不算太差,相比,vb.net语言描述版本的翻译杨浩应该比较好一点. 

4) 
Microsoft.NET程序设计技术内幕 
 Programming Microsoft .NET  
作者:[美]Jeff Prosise /著 
译者:王铁 等/译 
出版社:清华大学出版社 

本书是《微软.NET程序员系列》丛书之一,主要讲述Microsoft.NET编程技术,可帮助你快速而深入地理解.NET框架的主要编程模型。本书是开发.NET Web应用程序的开发人员必读的经典著作。 
中文版翻译质量很好. 

5) 
深入剖析ASP.NET组件设计  
 作者:黄忠成 编著 
出版社:电子工业出版社 

这是一本专门讨论ASP.NET组件设计的书籍,与已有的同类书相比,本书提供了更为完整的范例,对ASP.NET核心运作模式做了更为深入的探讨,并且纳入了许多书籍跳过不谈的章节——IDE环境。因此,它为目前惟一一本深入探讨ASP.NET核心、IDE交互、提供完整且具商业价值范例的ASP.NET组件设计专著。 

6) 
ADO.NET本质论 
 Essential ADO.NET  
 作者:(美)Bob Beauchemin 
译者:周靖 
出版社:清华大学出版社 
原出版社: Addison Wesley/Pearson 

本书由资深数据库教师编写,全面介绍了ADO.NET。书中深入剖析了ADO.NET的本质,探索了类、接口、属性和方法的工作原理,同时还为其他数据访问API(包括OLEDB,ADO,ODBC和JDBC)的程序员,提供了有价值的参考材料。本书适合具有一定数据库基础的开发人员阅读. 
译者周靖的翻译水平在国内应该是非常高的,对这本书原版的诠释也是非常好,推荐. 

7) 
ADO.NET高级编程  
 作者:Paul Dickinson 等/著 
译者:张晓明 等/译 
出版社:中国电力出版社 

本书是一本关于ADO.NET的权威指南,书中提供了大量实用的代码示例、丰富的技术信息和详细的学习案例。无论你想使用ASP.NET开发Web应用程序、Windows窗体应用程序还是XML web服务,本书都将有助于你理解如何运用.NET的数据访问技术以实现最大效率。 
翻译水平算中上... 
继续添加几本书: 
从amazon上面找了几本星级比较高的,虽然没看过,但是应该是值得推荐的. 
1) 
VB.NET和ASP.NET编程手册 
 The Ultimate VB.NET and ASP.NET Code Book 
作者:[美]Karl Moore 
译者:高升 李耀华 
出版社:清华大学出版社 

这本书在目前amazon书店为4星半级,但是在国内的中文版很奇怪,都没看到什么评论.没看过中文版原书,加上对翻译者不熟悉,所以暂时不知道翻译的水平如何. 
现在网上同样有这本书的电子版,可以看看原版再决定其价值. 
本书既适合经验丰富的VB.NET和ASP.NET开发人员,也适合.NET初学者,具有很高的学习参考价值 

2)ASP.NET基础教程-Visual Basic .NET案例版 
Essential ASP.NET with Examples in Visual Basic .NET 

ASP.NET基础教程-C#案例版 
Essential ASP.NET with Examples in C# 

作者  : (美)Fritz Onion/   
译者  : 施诺/   

"这是一本思路清晰而且结构良好的教程,字里行间展示了作者渊博的知识和宝贵的经验。它抓住了ASP.NET的真实本质,引领读者将自身的专业和构架技能提升到一个更高的层次。" 
                             --J. Fred Maples,软件工程部主任,NASDAQ.com 
2月27日

<奇幻世界>

  还在看<奇幻世界>,突然想起大三的时候看这杂志的情形.
  本来这个杂志是自己的爱好,别人也爱理不理,自己也看得舒服,偶尔跟施衡一起吹吹,毕竟他也看这个.
  有一次看到一部长篇<天行健>,燕垒生的,精彩的没话说,就推荐给宿舍里两个姓张的,他们看前很不屑,看之后就开始期待下一期的<奇幻>了.
  等到后一期出来以后,他们开始催我再去买了,我说我们平分费用吧,他们死活不同意,那大家就耗着吧.这段日子我们过得都比较痛苦,最后他们还是妥协了,答应平分费用.
  不过问题又来了,一本<奇幻>8块,我们是三个人,又比较难处理.经过讨论,我们来猜拳决定谁只要出两块钱.胜利者当然是我这个猜拳界的无冕之王了.
  本以为这个传统可以保留下来,但后来发现姓施的每期必买,我们就都放弃之前的想法了,每次都专心等着他看完之后借过来,书非借不能读也,看借来的书,效率高而且耐性好,我们经常会很投入的坐一个上午或者晚上把一篇故事读完,所以后来就有同学说"其实那时你也挺认真的嘛".
   ps:现在已经到了<天诛>第三部下了
2月23日

BON JOVI

 I listened to BON JOVI for a night,and my conclusion is : it is not my type.I still enjoy Andy Liu,and I call myself as his fans.
2月22日

english is not my favourate,but important

   I don't like english ,but that not stand for my blog. To use English in the public like to do things in the stage, the audience are looking at you, if you have some mistakes ,they will say"So poor english level and so poor person", so you have to say every word carfully at first.Day after day, when you are familiar with the words, the dialog and the meaning of English ,you can relax your brain to write a passage in english and you can talk with some foreigners in english.
   Now i have not the enviornment to practise my oral english , but i'd like to create the enviornment by myself. And i will hold my faith.
2月18日

how to subscribe someone's blog?

   the most famous topic is 3G and web2.0,both of which i know little about.Some day i surfed on the web, then some guy said that he has subscribed a famous man's blog and he could get most useful information.To be strong, you have to learn the good and better things from others, so i decide to subscribe some also, then i can know something about the latest technology and information.
   Brothers and sisters, welcome to follow some words about the new things.
   (ps: when i use the PowerWord to look up the word subscribe in Chinese, the tool show me subscibe.Well ,i use the 2005 version)
2月17日

good thing

MSN space 扩展(转贴)

Windows Media Player PowerToy

这个工具是最常见的,为你的 MSN Spaces 添加一个在线播放器,可以播放电影或者音乐。无需多说咯。

使用方法:

  1. 进入 MSN Spaces 的编辑页面。
  2. 在编辑页面的地址(这时在地址栏中显示的地址)后面附加上“&powertoy=musicvideo”后回车。
  3. 新的页面载入后,点击“自定义”,在模块的下拉菜单中就有一个新的“PowerToy:Windows Media Player”,点击一下增加,然后保存。
  4. 这样就会有一个新的模块 Window Media Player,目前该模块只有英文界面。
  5. 注意媒体文件的地址 URL,只支持 WMA, WMV, WAV, AVI, MPG, MPEG, MP3 格式(如需要支持播放列表,请看这里),除外的格式将无法正常保存,导致预览时播放器的按钮为灰白
  6. 如果想页面载入时自动播放的话,只需勾上 Auto Start;播放次数可以设置 Times to play。其他参数如播放器的外观等默认无妨。
  7. 这样,你的 MSN Spaces 就有了在线播放器的功能了。

Tweak UI PowerToy

这个功能模块可以调整 MSN Spaces 各个模块的外观。MSN Spaces 就是由不同的模块组成了,调整模块的外观也就调整了整个 Blog 的外观,调整选项包括背景图片,文字,颜色,边框,透明度等等。

使用方法:

  1. 进入 MSN Spaces 的编辑页面。
  2. 在编辑页面的地址(这时在地址栏中显示的地址)后面加上“&powertoy=tweakomatic” 回车。
  3. 新的页面载入后,点击“自定义”,在模块的下拉菜单中就有一个新的“PowerToy:Tweak UI”,点击一下增加,然后保存。
  4. 这样就会有一个新的面板,里面有许多的选项,根据你的想法调整 MSN Spaces 的外观吧。

Custom HTML PowerToy

这个工具可以为 Spaces 添加一个模块让你插入任意的一段 HTML 代码。这样通过这个模块,你就可以借助 HTML 语言显示许多原本不能显示的内容,大大增强了 MSN Spaces 的灵活性。另外对于这个模块的显示,你还可以自定义模块的名称,是否显示边框等。遗憾的是,因为安全问题,微软过滤了诸多灵活的 HTML 标签。

使用方法:

  1. 进入 MSN Spaces 的编辑页面。
  2. 在编辑页面的地址(这时在地址栏中显示的地址)后面加上“&powertoy=sandbox” 回车。
  3. 新的页面载入后,点击“自定义”,在模块的下拉菜单中就有一个新的“PowerToy:Custom HTML”,点击一下增加,然后保存。
  4. 这样就会有一个新的模块设置。你可以输入 HTML 代码,另外还有关于名称和是否显示边框的设置。
2月13日

the experience of helping hold a wedding

   we got up at 6:00, then the bridegroom telephoned me and asked us to help him and he was at the store buying something. We walked as quickly as possible and arrived there at 6:15, then the groom said"i need some bullon, help me blow some" we faint!
    At about 8:00 o'clock, we were on the way to the home of the bride.Her family welcomed us warmly and fired many firecracker.The bride was no more beautiful and the groom was no more happy.
    When they got the house of the groom, the climax came.We stopped the bride and said"You can go to the bridal chamber only if you satisfy our requests,otherwise, you have to stand here until tomorrow! ""what requests?""ten packets of cigarette each person."the bride was a little hesitate,"well, eight is ok, we are not man so  bad." Hearing this ,the bride about to accept the requests. Suddenly the groom's father came out and said "guys, you have to let the bride in before 11 o'clock,being late is not good according the custom" we looked at the clock,it's 10:56.Well , we have to obey the father's order, and the bride got into the room very easily.We showed our unsatisfication to the father, the father said"it's my daughter_in_law, i should help her"  We faint again.
2月5日

the things not willing to do but have done

     i am not willing to hurt persons around me , but i have done so.This makes everyone unhappy.In the new year , i decide to try my best to do everything well and learn to take care of others.
    i am not willing to drink too much when i stay at home, but i have done so. Twice of drunk in the year of 2006,one on the occaision of getting together with my classmates in the middle school
,and the other with my friends.But back to the word, after drinking , many words get out of my mouth and these words often just stay in my heart.
    i am not willing to wash my body too often ,but i have done so. every time after i have done so, my mother said to me"you have turned white ",is there so much ash on my body?
1月30日

Happy New Year

   With full mouth of chips, i get into the year of 2006 with my mother and father.2005 is a year full of challenge and chance, cheers and pains, i have tried my best to face the difficulties and every unexpectede condition. During this process, i got some fellows and made my aims clear.
   To be a expert, i have to practice my skill ,expand my knowledge, and hold to my faith, get out of the temptation.
    "Can you say some English words?"
    "Come on,baby!"
1月23日

what was web?

Somebody asked me why i didn't surf on web those days, i replied him"what is web". Except that i logged on my QQ to communicate with my manager, i hadn't touched the web for about one week. When others were in the dormitory on the evening of Friday, i was in the company to modify the program , when others were still in the bed on Saturday morning , i was in the company to look for the bugs in the program. Oh, God! i am now a intern with a salary with 1500 yuan a month ,not a worker with 5100 yuan a month.  My kitty stomach disappears day after day, my wonderful imagination disappears day after day. They often called me Owen those days,but now they call me Ronaldo. Even i don't really mind the nickname, but it shows my condition now.Being a great player , i must keep my status steadily to keep away the imputation.Maybe i forgot to wash my face this morning.
12月19日

如果我投资拍电影

杜其峰(导演) + 杜可风(摄影)+《幻城》(剧本)+《发如雪》(主题曲),哈哈,够了。
12月16日

The odd patterns

    My master taught me three design patterns the day before yesterday. Maybe i am a little stupid, for i use an hour to understand the example, then use two hours to think the patterns , only two of them can i get the meaning. i asked Master about the third pattern, after about half an hour's explain, i can catch the shape of the pattern finally.But if you ask me to use this patterns in practice skillfully, i think it still has a long time to go.
     Yesterday, Master give me another example ,hehe, another meal to digest.