近排有d project 連同 IIS 由 ASP.NET 2.0 一升升到 ASP.NET 4.0, 當中都好多改進係值得加以應用:
| Feature & rating | Description |
|---|---|
| DataPager .NET 4.0
|
依個一定要, 除非個 website d data 少到可憐!
DataPager provides paging support to the ListView control. The best advantage is that you need not have to keep it ‘tied’ with the control on which the paging is being done. You can keep it anywhere on the page. DataPager gives you a consistent way of paging with the controls that support it. Currently only ListView supports it as it implements the IPageableItemContainer. However support is likely to be added to other List controls as well.
|
| Extensible Output Caching .NET 4.0 |
用 memcached 會方便d
ASP.NET 4 adds extensibility to output caching that enables you to configure one or more custom output-cache providers. Output-cache providers can use any storage mechanism to persist HTML content. These storage options can include local or remote disks, cloud storage, and distributed cache engines. |
| Expanding the Range of Allowable URLs
.NET 4.0
|
視乎需要吧, 我試過有d 網站的確需要依個 feature (不過唔係我設計)
ASP.NET 4 introduces new options for expanding the size of application URLs. Previous versions of ASP.NET constrained URL path lengths to 260 characters, based on the NTFS file-path limit. In ASP.NET 4, you have the option to increase (or decrease) this limit as appropriate for your applications, using two new attributes of the httpRuntime configuration element. The following example shows these new attributes.
<httpRuntime maxRequestPathLength=”260″ maxQueryStringLength=”2048″ /> ASP.NET 4 also enables you to configure the characters that are used by the URL character check. When ASP.NET finds an invalid character in the path portion of a URL, it rejects the request and issues an HTTP 400 (Bad request) status code. In previous versions of ASP.NET, the URL character checks were limited to a fixed set of characters. In ASP.NET 4, you can customize the set of valid characters using the new requestPathInvalidChars attribute of the httpRuntime configuration element, as shown in the following example: <httpRuntime requestPathInvalidChars=”<,>,*,%,&,:,\,?” /> (In the string that is assigned to requestPathInvalidChars by default, the less than (<), greater than (>), and ampersand (&) characters are encoded, because the Web.config file is an XML file.) By default, the requestPathInvalidChars attribute defines eight characters as invalid. |
| Session State Compression .NET 4.0
|
終於 official 支援, 不過 View State Compression 呢? HTTP compression 經已足夠了。
By default, ASP.NET provides two options for storing session state across a Web farm. The first option is a session state provider that invokes an out-of-process session state server. The second option is a session state provider that stores data in a Microsoft SQL Server database.
Because both options store state information outside a Web application’s worker process, session state has to be serialized before it is sent to remote storage. If a large amount of data is saved in session state, the size of the serialized data can become very large. ASP.NET 4 introduces a new compression option for both kinds of out-of-process session state providers. By using this option, applications that have spare CPU cycles on Web servers can achieve substantial reductions in the size of serialized session state data. You can set this option using the new compressionEnabled attribute of the sessionState element in the configuration file. When the compressionEnabled configuration option is set to true, ASP.NET compresses (and decompresses) serialized session state by using the .NET Framework GZipStreamclass.
|
| Permanently Redirecting a Page .NET 4.0
|
方便左d
Content in Web applications is often moved over the lifetime of the application. This can lead to links to be out of date, such as the links that are returned by search engines.
In ASP.NET, developers have traditionally handled requests to old URLs by using the Redirect method to forward a request to the new URL. However, the Redirect method issues an HTTP 302 (Found) response (which is used for a temporary redirect). This results in an extra HTTP round trip. ASP.NET 4 adds a RedirectPermanent helper method that makes it easy to issue HTTP 301 (Moved Permanently) responses, as in the following example: RedirectPermanent(“/newpath/foroldcontent.aspx”);
|
| Auto-Start Web Applications
.NET 4.0 |
跟本上好多 web application 唔適合行得咁耐, 亦有好多更好既方法可以避免個 web application 行得太耐, 所以冇乜用。 另外依個 feature要行 Windows 2008
Some Web applications must load large amounts of data or must perform expensive initialization processing before serving the first request. In earlier versions of ASP.NET, for these situations you had to devise custom approaches to “wake up” an ASP.NET application and then run initialization code during the Application_Load method in the Global.asax file.
To address this scenario, a new auto-start feature is available when ASP.NET 4 runs on IIS 7.5 on Windows Server 2008 R2. The feature provides a controlled approach for starting up an application pool, initializing an ASP.NET application, and then accepting HTTP requests. It lets you perform expensive application initialization prior to processing the first HTTP request.
|
| ASP.NET Chart Control
.NET 4.0 (3.5 要另外加 assembly)
|
希望越大失望越大, 原本對 Chart Control 好有期望, 點知好失望。可能係 Internet Explorer 個 SVG engine 太癈既關係, 所以 ASP.NET 個 chart control 只係 output bitmap 而唔係 SVG, 所以除左當做 fallback, 功能上對比其他 opensource 既 chart control冇乜突出既地方。
The ASP.NET chart server control enables you to create ASP.NET pages applications that have simple, intuitive charts for complex statistical or financial analysis. The chart control supports the following features:
|
~ 待續 ~





