asp.net4.0的新特性入門概述

來源:互聯網
上載者:User

前言:asp.net4.0出來很長一段時間了,可是筆者自己還在學習和使用2.0做項目。為了不至於目光太短淺,在學習能力還沒有被廢掉之前,看了幾篇介紹4.0的文章。現在總結一下,做個筆記,入門學習一下。如果將來將每個新特性都深入使用一遍最好^_^。
1、控制ViewState -- 現在EnableViewState這個屬性預設是True,很多時候即使我們並不需要它,但是很多開發人員極少去將它設定為False(怕出現問題或者根本不知道,這點筆者也要檢討),asp.net的資源很大一部分是浪費在這個上面的。在4.0中,改變了這種做法,EnableViewState預設是False,這其實也變相提高了開發人員的要求,因為開發人員必須清楚知道哪些ViewState需要設定為True。
英文原文是這麼說的:
 Control over View State -- Currently, view state is enabled for all controls by default. Most developers are pretty lazy about disabling view state when they don't need it. In ASP.NET Web Forms 4.0, you can invert the normal state of things and disable view state by default.
2、控制用戶端IDs -- 這個特性將大大減少用戶端工作量,你可以在伺服器端產生html標籤用javascript與css。對於很多從事asp.net的開發人員而言,js動作伺服器控制項是很不爽的(和jsp及php比起來,這或者是asp.net被人詬病的一個短板),估計是群眾的呼聲讓ms最後妥協了。有了4.0,擷取伺服器控制項id就像其他動態網頁面技術一樣輕鬆(忘掉討厭的綁定和ClientID擷取dom元素的id吧)。
英文原文: 
Control over client IDs -- This is a welcome feature for those of us who do a lot of client-side programming.
This change will make it much easier to target HTML tags rendered by server-side controls with JavaScript
and Cascading Style Sheets.
3、更好的支援web開發標準 -- 這個估計ms也是順應潮流吧,ie7,8都向web標準靠攏設計出來了。不過ms還保留有很多自己的標準,所以才說“更好的支援”而沒有說“完全相容”,想統一標準,難哪。
英文原文:
Better support for web standards -- Several improvements have been made to the ASP.NET Web Forms 4.0 framework that enable you to more easily build websites that are compliant with web standards such as XHTML and Accessibility standards. For example, you can prevent a FormView control from rendering an HTML table automatically.
4、QueryExtender 控制項 --每次ms出新東西,似乎總有讓程式員變得更傻的創舉。 用新的QueryExtender控制項能使你更容易過濾資料檢索EntityDataSource或者LinqDataSource控制項。對於拖控制項的開發人員而言,再輕鬆不過了。
英文原文: 
 QueryExtender Control -- The new QueryExtender control enables you to easily filter data retrieved by
the EntityDataSource or LinqDataSource controls. You can use it to easily create search pages.
5、搜尋引擎的最佳化 (SEO) -- 更加友好的URLs使得搜尋引擎更容易去索引你的網頁。
英文原文:
Search Engine Optimization (SEO) -- There are several new features added to the ASP.NET framework
that make it easier to get your website pages indexed by search engines. For example, the new ASP.NET Web Forms Routing framework enables you to expose your ASP.NET pages with more intuitive URLs.
6、動態資料的改進 -- Entity模板使你能建立模板為顯示、修改,還有建立新的實體物件,一如既往,方便的一塌糊塗。
英文原文:
Improvements to Dynamic Data -- Several great new features are being added to Dynamic Data. My favorite new feature is Entity Templates which enable you to create templates for display, editing, and inserting new instances of an entity (such as a Product entity).

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.