- Eroare
| ASP.NET 4.0 Features - Visual Studio 2010 |
|
| Scris de Administrator |
| Miercuri, 12 Mai 2010 18:40 |
| Vizualizări: 749 |
|
by Ludmal De Silva ASP.NET v4 is released with Visual studio 2010. Web developers are presented with a bewildering range of new features and so Ludmal De Silva has described what he considers to be the most important new features in ASP.NET V4 He focus of Microsoft’s latest ASP.NET 4 has mainly been on improving the performance and Search-engine Optimization (SEO). In this article, I'll be taking a look at what I think are the most important new features in ASP.NET 4.
I’ll describe the details of each of these features in the following sections.
Output Cache extensibility
Output caching, or Page-Level Caching, caches the entire rendered markup of an ASP.NET web page for a specific time-period. This has always been one of the essential features for ASP.NET that is used extensively to increase application performance. However there have been some limitations on the feasible extent of caching, because cached content always had to be stored in-memory. But with ASP.NET 4.0 developers can extend their caching by using Output-cache providers. Developers can now create ‘output-cache providers’ that store the cache contents to any persistence mechanism such as databases, disks, cloud storage and distributed cache engines.
To create a custom output-cache provider, a class which derived fromSystem.Web.Caching.OutputCacheProvider has to be created in ASP.NET 4.0. There are four public methods which you have to override in order to provide your own implementation for add, remove, retrieve and update functionality. Also, the output-cache provider has to be registered in the web.config file as shown in the following screen capture.
You can also set this custom output-cache provider as your default cache mechanism. So once you add the page cache directives all of your contents will be stored using the custom output-cache provider.
Moreover, developers can also dynamically configure which output-cache Provider is used. For example you might want to cache the frequently access pages in the memory for faster access and less frequent pages on disk. By overriding the GetOutputCacheProviderName() method you can configure which output cache provider to use for different requests. These additions to the output-cache can enable developers to write extensible and more efficient cache mechanisms to their web application and thereby improve its responsiveness.
Session State compression
The ASP.NET session state is a mechanism to maintain session-specific data through subsequent requests. In some instances, you may wish to store your session state data in a session-state server or in Microsoft SQL server. However, these two options require you to store data out of the web application’s worker process. To send across to the relevant sources, (State server or Microsoft SQL Server), session-state data has to be serialized. This can take a significant time if the size of the data to be serialized grows significantly. This will increase the latency of the application.
This latency can be reduced if the size of the data is lessened by compression. ASP.NET 4.0 introduces a new mechanism to compress your session state data for both Session-state server and Microsoft SQL server. Compression can be enabled by setting the compressionEnable to true in the web.config file. In this example, the session-state data will be serialized/desterilized using System.IO.Compression.GZipStream.
<sessionState mode="SqlServer" sqlConnectionString="data source=DB;Initial Catalog=LudmalDB" allowCustomSqlDatabase="true" compressionEnabled="true"/>
With this compression feature, developers can often reduce the time it takes for a web application to respond by reducing the size of session data. View State mode for Individual Controls View state is a mechanism to maintain page controls’ state on subsequent post backs. ASP.NET stores the view state data for controls that are in the page, even if it’s not necessary. Since the view state data is stored in the pages’ html, the size of the request object will be increased, and make performance worse. In ASP.NET 4.0, each web control will include a ViewStateMode property which lets developers disable view-state by default, and enable it just for the controls for which a persistence of state is required. ViewStateMode has the following three values;
By setting these values in page controls accordingly, a significant performance improvement can be gained in response-time.
Page.MetaKeywords and Page.MetaDescription properties
To increase the relevance of pages in searches, developers should include relevant “keyword” and “description” meta tags in the html <head> section. Unfortunately, it takes some time to add these tags for each and every page, and the alternative of adding these tags programmatically was difficult. But with ASP.NET 4.0, there are two new properties in the code behind file;
This will enable developers to easily and programmatically add the relevant keywords and description.
This will even be useful for Master pages—where you only have to add these properties in the master page. In addition to “keywords” and “description” settings in the code behind, developers can also set these values within the @Page directive.This will even be useful for Master pages—where you only have to add these properties in the master page. In addition to “keywords” and “description” settings in the code behind, developers can also set these values within the @Page directive. Routing in ASP.NETRouting will let developers serve meaningful URLs to users and map them with the actual physical files. This URL-rewriting mechanism enables developers to write high ranking, search-engine optimized web applications. For example, URL for a page which displays an actual product might look like the following; By using routing the URL will look like the following
The following example shows how to implement routing behavior in ASP.NET 4 using new MapPageRoute in Route class. public class Global : System.Web.HttpApplication
{ void Application_Start(object sender, EventArgs e) { RouteTable.Routes.MapPageRoute("ProductsRoute", "product/{prodId}", "~/products.aspx"); } }
|
Sustin - Promovez

Campania de panotaj "Avortul opreste o inima care bate!" a inceput in Bucuresti
ACTUALIZARE 30 martie 2011: Primul panou a fost deja decorat si se afla la intersectia intre Bd. Libertatii si Calea 13 Septembrie, vis-a-vis de Palatul Parlamentului (vezi foto). Locatia a fost aleasa pentru a atrage atentia alesilor nostri. Simultan cu montarea panoului, toti parlamentarii romani in functie au primit o informare cu privire la desfasurarea "Marsului pentru viata" 2011.
In zilele urmatoare vor fi decorate si alte panouri.
Va multumim mult pentru sprijinul acordat si asteptam in continuare donatiile voastre pentru a continua campania!
Detalii despre campania de panotaj la: www.ProVitaBucuresti.roCanal video Pro-Vita:
Pro Vita Bucuresti pe Vimeo



Proiectul "Pentru-Viata" - PentruViataCluj.ro
"Raspunsul la criza unei sarcini este eliminarea crizei, nu a copilului."
(Jeannie W. French)
| DONEAZA - Ajutorul tau conteaza! |
Asociatia "Pro-Vita pentru nascuti si nenascuti" - Filiala Bucuresti a Asociatiei mama din Valea Plopului si Valea Screzii, Jud. Prahova (zona Valenii de Munte circa 110 km de Bucuresti) unde sunt si asezamintele de plasament familial Pro-Vita conduse de preotul Nicolae Tanase.
|
Valea Plopului, Valea Screzii - Ajutor din partea Fundatiei Crestine Parintele Arsenie Boca - Iarna 2010
"Valea Plopului este raspunsul la intrebarea daca va mai exista crestinism in Europa." Dr. Iosif Niculescu, 95 de ani
Tabara de vara de voluntari ASCOR "Impreuna pentru copiii de la Valea Plopului" - Editia III - 12-26 iulie 2010



- Pr. Nicolae Tanase
- Pr. Ilie Cleopa
- Maica Siluana Vlad
- Danion Vasile
- Pr. Teofil Paraian
- Pr Arsenie Papacioc
- Pr Constantin Galeriu
- Pr Dan Badulescu
- Pr Vasile Mihoc
- Ier. Savatie Bastovoi
- Dr. Pavel Chirila
- Laurentiu Dumitru
- Dan Puric
- Virgiliu Gheorghe
SufletOrtodox.ro
Arhiva-Ortodoxa.info
Resurse-Ortodoxe.ro
Decalogul (Cele 10 porunci) a fost primit de Moise de la Dumnezeu pe muntele Sinai. Respectarea sa reprezinta conditia obligatorie pentru dobandirea mantuirii. - Ce invata aceste porunci? - Ro.OrthodoxWiki.org


Citate
" Toata lumea stie ca anumite lucruri sunt irealizabile, pana cand vine cineva care nu stie acest lucru si le realizeaza. "
Albert Einstein
(n. 14 martie 1879, Ulm - d. 18 aprilie 1955, Princeton)
Prieteni
- Adrian Nuta- Bogdan I. Stanciu
- Bogdan Mateciuc
- Danion Vasile
- Dr. Christa Todea-Gross
- Dr. Pavel Chirila
- Dr. Virgiliu Stroescu
- Florian Colceag
- Gigel Chiazna
- Laurentiu Dumitru
- Liliana Munteanu
- Maica Siluana Vlad
- Mirela Horumba
- Pr. Mihail Stanciu
- Pr. Nicolae Tanase
- Rafael Udriste










