天天看點

ASP.NET 3.5的新特色 vs2008

ASP.NET 3.5 and Visual Studio 2008

ASP.NET 3.5 and Visual Studio 2008 bring great new functionality around Web development and design that makes building standards based, next generation Web sites easier than ever. From the inclusion of ASP.NET AJAX into the runtime, to new controls, the new LINQ data capabilities, to improved support for CSS, JavaScript and others, Web development has taken a significant step forward.

ASP.NET 3.5 and Visual Studio 2008為基于Web的開發和設計,帶來了巨大的功能性變化,這使得建立标準Web程式比以前更容易。在運作時中包含的ASP.NET AJAX,增加了新的控件,新的LINQ資料資料能力,增強了對CSS、JavaScript和其他内容的支援,Web開發人員從此邁出了更為重要的一步。

ASP.NET 3.5的新特性:

1.ASP.NET AJAX

With ASP.NET AJAX, developers can quickly create pages with sophisticated, responsive user interfaces and more efficient client-server communication by simply adding a few server controls to their pages. Previously an extension to the ASP.NET runtime, ASP.NET AJAX is now built into the platform and makes the complicated task of building cross-platform, standards based AJAX applications easy.

使用AJAX,開發人員可以快速的建立靈活多變、快速響應得使用者界面,而實作這些功能,隻需要在頁面中添加幾個伺服器控件,以前AJAX隻是ASP.NET運作時的一個擴充,現在它被內建在.NET平台上,而且能夠完成更負責的跨平台任務,建立标準的AJAX應用程式變得更簡單。

2.LINQ and other .NET Framework 3.5 Improvements

With the addition of Language Integrated Query (LINQ) in .NET Framework 3.5, the process of building SQL queries using error-prone string manipulation is a thing of the past. LINQ makes your relational data queries a first-class language construct in C# and Visual Basic, complete with compiler and Intellisense support. For Web applications, the ASP.NET LinqDataSource control allows you to easily use LINQ to filter, order and group data that can then be bound to any of the data visualization controls like the ListView and GridView controls. In addition, all the other improvements to .NET Framework 3.5, including the new HashSet collection, DateTime offset support, diagnostics, garbage collection, better thread lock support, and more, are all available to you in your ASP.NET applications.

NET Framework 3.5中增加了LINQ查詢語言,以前我們在使用SQL查詢字元串時總是容易出錯,現在,LINQ為C#和VB提供了更安全的架構,并提供更智能的支援。對于Web應用程式,ASP.NET中的LinqDataSource資料源控件允許我們輕松的去查詢、過濾等資料操作。.NET Framework 3.5其他的特性還包括:HashSet集合,DateTime offset支援,diagnostics異常(診斷)處理,garbage(垃圾回收)集合,更好的線程鎖定支援等等。這裡的garbage聽起來很像Java的GC,不知道是不是呢,試驗下就知道了。

3.WCF Support for RSS, JSON, POX and Partial Trust

With .NET Framework 3.5, Windows Communication Foundation (WCF) now supports building Web services that can be exposed using any number of the Internet standard protocols, such as SOAP, RSS, JSON, POX and more. Whether you are building an AJAX application that uses JSON, providing syndication of your data via RSS, or building a standard SOAP Web service, WCF makes it easy to create your endpoints, and now, with .NET Framework 3.5, supports building Web services in partial-trust situations like a typical shared-hosting environment.

在.NET Framework 3.5中,WCF支援建立Web服務(被大多數網絡标準協定支援,如SOAP,RSS,JSON,POX等),無論你是使用JSON開發AJAX程式,還是RSS,或是标準的SOAP Web服務。 WCF使你可以輕松的建立終端程式,現在,.NET Framework 3.5還支援在局部信任領域(類似一個典型的主機共享環境)建立Web服務。

Visual Studio 2008的新特性

1.New Web Design Interface

Visual Studio 2008 has incorporated a new Web designer that uses the design engine from Expression Web. Moving between design and source view is faster than ever and the new split view capability means you can edit the HTML source and simultaneously see the results on the page. Support for style sheets in separate files has been added as well as a CSS properties pane which clarifies the sometimes-complex hierarchy of cascading styles, so that it is easy to understand why an element looks the way it does. In addition Visual Studio 2008 has full WYSIWYG support for building and using ASP.NET Nested Master Pages which greatly improves the ability to build a Web site with a consistent look and feel.

Visual Studio 2008提供了新的界面,這也算是VS一貫的做法了(界面風格每次都在變)。VS2008去除了設計器和源代碼視圖,這使得打開VS2008的界面比以前更快。新的分割視圖,允許你編輯HTML源代碼,并檢視頁面效果。對層疊樣式表的支援能力大大增強。控件的樣式可以立刻顯現出來,這也是鼎鼎大名的WYSIWYG(所見即所得)。VS2008支援嵌套母版頁開發,這樣的頁面看起來,會有什麼樣的效果呢,自己下載下傳一個版本看看吧。

2.JavaScript Debugging and Intellisense

In Visual Studio 2008, client-side JavaScript has now become a first-class citizen in regards to its debugging and Intellisense support. Not only does the Intellisense give standard JavaScript keyword support, but it will automatically infer variable types and provide method, property and event support from any number of included script files. Similarly, the JavaScript debugging support now allows for the deep Watch and Locals support in JavaScript that you are accustomed to having in other languages in Visual Studio. And despite the dynamic nature of a lot of JavaScript, you will always be able to visualize and step into the JavaScript code, no matter where it is generated from. This is especially convenient when building ASP.NET AJAX applications.

在VS2008中,用戶端不再僅僅支援标準JavaScript的對象,而且能自動地顯示那些自定義的變量和方法,更強的腳本調試功能(具體什麼自己測試下)。

3.Multi-targeting Support

In previous versions of Visual Studio, you could only build projects that targeted a single version of the .NET Framework. With Visual Studio 2008, we have introduced the concept of Multi-targeting. Through a simple drop-down, you can decide if you want a project to target .NET Framework 2.0, 3.0 or 3.5. The builds, the Intellisense, the toolbox, etc. will all adjust to the feature set of the specific version of the .NET Framework which you choose. This allows you to take advantage of the new features in Visual Studio 2008, like the Web design interface, and the improved JavaScript support, and still build your projects for their current runtime version.

在以前的VS中,你隻能建立一個版本下的工程(如隻能建立2.0版本或1.1版本),在VS2008中,我們可以包含多個版本了,通過一個簡單的下拉操作,你就可以決定要建立哪個版本下的項目(包括2.0,3.0,3.5)。不管采用哪個版本,你都可以使用VS2008提供的新功能,如在Web開發中,你可以在舊的項目中,使用VS2008提供的對JavaScript的支援。

繼續閱讀