SlideShare une entreprise Scribd logo
1  sur  34
What's new in ASP.NET 4.0
  Quick Overview of Important Features



                Sunil Pottumuttu
ASP.NET 3.5 Service Pack 1
 Microsoft Entity Framework
 ADO.NET Data Services
 Dynamic Data
Overview of Talk
 ASP.NET supports several very different types
 of web applications
Web.config File Refactoring
<?xml version="1.0"?>
<configuration>
<system.web>
<compilation targetFramework="4.0" />
</system.web>
</configuration>
Extensible Output Caching
 ASP.NET 4.0
  OutputCacheProvider - create a custom output-
  cache provider as a class that derives from the new
  System.Web.Caching.OutputCacheProvider
  Providers for 3rd Party, Velocity, FileSystem
Output Caching Configuration

<caching>
<outputCache defaultProvider="AspNetInternalProvider">
<providers>
<add name="DiskCache"
type="Test.OutputCacheEx.DiskOutputCacheProvider,
   DiskCacheProvider"/>
</providers>
</outputCache>
</caching>
Output Caching Configuration at Page Level


<%@ OutputCache Duration="60" VaryByParam="None"
  providerName="DiskCache" %>
Auto-Start Web Applications
 Usual approach: Application_Start
 Auto-Start
   ASP.NET 4.0 + IIS 7.5
   AppPool startMode set to “alwaysRunning”
   IIS Application Warm-Up Module for IIS 7.5
     warm-up occurs during startup of the IIS service (if
     you configured the IIS application pool as
     AlwaysRunning) and when an IIS worker process
     recycles. During recycle, the old IIS worker process
     continues to execute requests until the newly
     spawned worker process is fully warmed up, so that
     applications experience no interruptions or other
     issues due to unprimed caches
IIS Configuration for the above

  In applicationHost.config


<applicationPools>
<add name="MyApplicationPool"
  startMode="AlwaysRunning" />
</applicationPools>
Permanently Redirecting a Page


 RedirectPermanent("/newpath/foroldcontent.aspx");
Session State Compression
   Used when state is out of porcess
   compressionEnabled in web.config
   DeflateStream/GZipStream
   Use System.IO.Compression.GZipStream
   Web.config
<sessionState mode="SqlServer"
      sqlConnectionString="data source=dbserver;Initial
      Catalog=aspnetstate"
      allowCustomSqlDatabase="true"
      compressionEnabled="true“
/>
Expanding the Range of Allowable URLs


  Previous versions of ASP.NET constrained
  URL path lengths to 260 characters, based
  on the NTFS file-path limit.

<httpRuntime
  maxRequestPathLength="260"
  maxQueryStringLength="2048" />
Request Path Valid Chars
   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

<httpRuntime requestPathInvalidChars="&lt;,&gt;,*,%,&amp;,:,,?" />

   By default, the requestPathInvalidChars attribute defines eight
   characters as invalid. (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.) You can customize the set of invalid characters as
   needed
Extensible Request Validation
System.Web.Util.RequestValidator

<httpRuntime requestValidationType="Samples.MyValidator, Samples" />


public class CustomRequestValidation : RequestValidator
{
protected override bool IsValidRequestString(
HttpContext context, string value,
RequestValidationSource requestValidationSource,
string collectionKey,
out int validationFailureIndex)
{...}
}
Object Caching and Object Caching Extensibility




System.Runtime.Caching.dll
Can Implement MemoryCache
Extensible HTML, URL, and HTTP Header Encoding

<httpRuntime
  encoderType="Samples.MyCustomEnco
  der, Samples" />

You can create a custom encoder by deriving from the new
   System.Web.Util.HttpEncoder

  After a custom encoder has been configured, ASP.NET
  automatically calls the custom encoding implementation
  whenever      public   encoding   methods    of    the
  System.Web.HttpUtility or System.Web.HttpServerUtility
  classes are called
Multi-Targeting

• <compilation targetFramework="4.0"/>
jQuery Included with Web Forms and MVC




 jQuery-1.4.1.js – The human-readable, unminified version
 of the jQuery library.
 jQuery-14.1.min.js – The minified version of the jQuery
 library.
 jQuery-1.4.1-vsdoc.js – The Intellisense documentation file
 for the jQuery library.
Content Delivery Network Support


<script src="http://ajax.microsoft.com/ajax/jquery/jquery-
   1.4.2.js" type="text/javascript"></script>

Supports SSL
More Details here: http://www.asp.net/ajaxlibrary/CDN.ashx

ASP.NET ScriptManager supports the Microsoft Ajax CDN
<asp:ScriptManager ID="sm1" EnableCdn="true" runat="server" />
ScriptManager Explicit Scripts
<asp:ScriptManager ID="sm1"
   AjaxFrameworkMode="Explicit" runat="server">
<Scripts>
<asp:ScriptReference Name="MicrosoftAjaxCore.js" />
<asp:ScriptReference
   Name="MicrosoftAjaxComponentModel.js" />
<asp:ScriptReference Name="MicrosoftAjaxSerialization.js" />
<asp:ScriptReference Name="MicrosoftAjaxNetwork.js" />
</Scripts>
</asp:ScriptManager>


** ScriptManager.AjaxFrameworkMode
Setting Meta Tags
Page.MetaKeywords and Page.MetaDescription
  Properties of Page class

<meta name="keywords" content="These, are, my,
  keywords" />
<meta name="description" content="This is the
  description of my page" />
                  OR

<%@ Page Language="C#" AutoEventWireup="true"
CodeFile="Default.aspx.cs"
Inherits="_Default"
Keywords="These, are, my, keywords"
Description="This is a description" %>
Enabling View State for Individual Controls

  ViewStateMode Property
    Enabled
    Disabled
    Inherit
  Enabled enables view state for that control
  and for any child controls that are set to
  Inherit or that have nothing set. Disabled
  disables view state, and Inherit specifies
  that the control uses the ViewStateMode
  setting from the parent control
ASP.NET Core Enhancements

 Cache Extensibility

 Auto-Start Web Applications

 Browser Capabilities Extensibility

 Session State Compression
ASP.NET Core Enhancements

 Cache Extensibility

 Auto-Start Web Applications

 Browser Capabilities Extensibility

 Session State Compression
Browser Definition Files

 blackberry.browser
 chrome.browser
 Default.browser
 firefox.browser
 gateway.browser

 generic.browser
 ie.browser
 iemobile.browser
 iphone.browser
 opera.browser
 safari.browser
Routing in ASP.NET 4
public class Global : System.Web.HttpApplication
{
     void Application_Start(object sender, EventArgs e)
     {
     RouteTable.Routes.MapPageRoute("SearchRoute",
           "search/{searchterm}", "~/search.aspx");
     RouteTable.Routes.MapPageRoute("UserRoute", "users/{username}", "~/users.aspx");
     }
}

Equivalent asp.net 4
RouteTable.Routes.Add("SearchRoute", new Route("search/{searchterm}",
new PageRouteHandler("~/search.aspx")));

string searchterm = Page.RouteData.Values["searchterm"] as string;
Accessing Routing Information in Markup

<asp:HyperLink ID="HyperLink1" runat="server"
NavigateUrl="<%$RouteUrl:SearchTerm=scott%>">
  Search for Scott</asp:HyperLink>
Setting Client IDs


   Predictable Client ID’s

<%@ Page Language="C#" AutoEventWireup="true"
CodeFile="Default.aspx.cs"
Inherits="_Default"
ClientIDMode="Predictable" %>
OR
<system.web>
<pages clientIDMode="Predictable"></pages>
</system.web>
Chart Control

 35 distinct chart types.
 An unlimited number of chart areas, titles,
 legends, and annotations.
 A wide variety of appearance settings for all chart
 elements.
 3-D support for most chart types.
 More than 50 financial and statistical formulas for
 data analysis and transformation.
 State management.
 Binary streaming.
New Syntax for HTML Encoded Expressions

Old Style
<%= HttpUtility.HtmlEncode(expression) %>

New style
<%: expression %>
Project Template Changes
Web Site project or Web Application project
Empty Web Application Template
Web Application and Web Site Project Templates
Dynamic Data

•RAD experience for quickly building a data-driven Web site.
•Automatic validation that is based on constraints defined in the data model.
•The ability to easily change the markup that is generated for fields in the
GridView and DetailsView controls by using field templates that are part of
your Dynamic Data project.

Contenu connexe

Tendances

APACHE WEB SERVER FOR LINUX
APACHE WEB SERVER FOR LINUXAPACHE WEB SERVER FOR LINUX
APACHE WEB SERVER FOR LINUXwebhostingguy
 
Apache Tutorial
Apache TutorialApache Tutorial
Apache TutorialGuru99
 
MuleSoft ESB Payload Encrypt Decrypt using anypoint enterprise security
MuleSoft ESB Payload Encrypt Decrypt using anypoint enterprise securityMuleSoft ESB Payload Encrypt Decrypt using anypoint enterprise security
MuleSoft ESB Payload Encrypt Decrypt using anypoint enterprise securityakashdprajapati
 
Apache web server installation/configuration, Virtual Hosting
Apache web server installation/configuration, Virtual HostingApache web server installation/configuration, Virtual Hosting
Apache web server installation/configuration, Virtual Hostingwebhostingguy
 
Apache web server
Apache web serverApache web server
Apache web serverzrstoppe
 
Web server installation_configuration_apache
Web server installation_configuration_apacheWeb server installation_configuration_apache
Web server installation_configuration_apacheShaojie Yang
 
Apache Web Server Architecture Chaitanya Kulkarni
Apache Web Server Architecture Chaitanya KulkarniApache Web Server Architecture Chaitanya Kulkarni
Apache Web Server Architecture Chaitanya Kulkarniwebhostingguy
 
Securing Your Web Server
Securing Your Web ServerSecuring Your Web Server
Securing Your Web Servermanugoel2003
 
Uniface Lectures Webinar - Application & Infrastructure Security - Hardening ...
Uniface Lectures Webinar - Application & Infrastructure Security - Hardening ...Uniface Lectures Webinar - Application & Infrastructure Security - Hardening ...
Uniface Lectures Webinar - Application & Infrastructure Security - Hardening ...Uniface
 
2009 - Microsoft IIS Vs. Apache - Who Serves More - A Study
2009 - Microsoft IIS Vs. Apache - Who Serves More - A Study2009 - Microsoft IIS Vs. Apache - Who Serves More - A Study
2009 - Microsoft IIS Vs. Apache - Who Serves More - A StudyVijay Prasad Gupta
 
Apache Presentation
Apache PresentationApache Presentation
Apache PresentationAnkush Jain
 

Tendances (20)

Apache
ApacheApache
Apache
 
Apache Web Server Setup 3
Apache Web Server Setup 3Apache Web Server Setup 3
Apache Web Server Setup 3
 
APACHE WEB SERVER FOR LINUX
APACHE WEB SERVER FOR LINUXAPACHE WEB SERVER FOR LINUX
APACHE WEB SERVER FOR LINUX
 
Apache Web Server Setup 1
Apache Web Server Setup 1Apache Web Server Setup 1
Apache Web Server Setup 1
 
Apache Tutorial
Apache TutorialApache Tutorial
Apache Tutorial
 
MuleSoft ESB Payload Encrypt Decrypt using anypoint enterprise security
MuleSoft ESB Payload Encrypt Decrypt using anypoint enterprise securityMuleSoft ESB Payload Encrypt Decrypt using anypoint enterprise security
MuleSoft ESB Payload Encrypt Decrypt using anypoint enterprise security
 
Apache web server installation/configuration, Virtual Hosting
Apache web server installation/configuration, Virtual HostingApache web server installation/configuration, Virtual Hosting
Apache web server installation/configuration, Virtual Hosting
 
5-WebServers.ppt
5-WebServers.ppt5-WebServers.ppt
5-WebServers.ppt
 
Apache web server
Apache web serverApache web server
Apache web server
 
Web server installation_configuration_apache
Web server installation_configuration_apacheWeb server installation_configuration_apache
Web server installation_configuration_apache
 
Apache Web Server Setup 2
Apache Web Server Setup 2Apache Web Server Setup 2
Apache Web Server Setup 2
 
Apache ppt
Apache pptApache ppt
Apache ppt
 
Apache Web Server Setup 4
Apache Web Server Setup 4Apache Web Server Setup 4
Apache Web Server Setup 4
 
Apache Web Server Architecture Chaitanya Kulkarni
Apache Web Server Architecture Chaitanya KulkarniApache Web Server Architecture Chaitanya Kulkarni
Apache Web Server Architecture Chaitanya Kulkarni
 
Securing Your Web Server
Securing Your Web ServerSecuring Your Web Server
Securing Your Web Server
 
Uniface Lectures Webinar - Application & Infrastructure Security - Hardening ...
Uniface Lectures Webinar - Application & Infrastructure Security - Hardening ...Uniface Lectures Webinar - Application & Infrastructure Security - Hardening ...
Uniface Lectures Webinar - Application & Infrastructure Security - Hardening ...
 
2009 - Microsoft IIS Vs. Apache - Who Serves More - A Study
2009 - Microsoft IIS Vs. Apache - Who Serves More - A Study2009 - Microsoft IIS Vs. Apache - Who Serves More - A Study
2009 - Microsoft IIS Vs. Apache - Who Serves More - A Study
 
Apache Presentation
Apache PresentationApache Presentation
Apache Presentation
 
Power shell
Power shellPower shell
Power shell
 
Web servers
Web serversWeb servers
Web servers
 

Similaire à Whats new in ASP.NET 4.0

ASP.NET Overview - Alvin Lau
ASP.NET Overview - Alvin LauASP.NET Overview - Alvin Lau
ASP.NET Overview - Alvin LauSpiffy
 
State management in ASP.NET
State management in ASP.NETState management in ASP.NET
State management in ASP.NETOm Vikram Thapa
 
nodejs_at_a_glance.ppt
nodejs_at_a_glance.pptnodejs_at_a_glance.ppt
nodejs_at_a_glance.pptWalaSidhom1
 
SynapseIndia dotnet client library Development
SynapseIndia dotnet client library DevelopmentSynapseIndia dotnet client library Development
SynapseIndia dotnet client library DevelopmentSynapseindiappsdevelopment
 
New Features Of ASP.Net 4 0
New Features Of ASP.Net 4 0New Features Of ASP.Net 4 0
New Features Of ASP.Net 4 0Dima Maleev
 
Rich Portlet Development in uPortal
Rich Portlet Development in uPortalRich Portlet Development in uPortal
Rich Portlet Development in uPortalJennifer Bourey
 
Asp.Net Ajax Component Development
Asp.Net Ajax Component DevelopmentAsp.Net Ajax Component Development
Asp.Net Ajax Component DevelopmentChui-Wen Chiu
 
Multi Client Development with Spring
Multi Client Development with SpringMulti Client Development with Spring
Multi Client Development with SpringJoshua Long
 
SCWCD : Servlet web applications : CHAP 3
SCWCD : Servlet web applications : CHAP 3SCWCD : Servlet web applications : CHAP 3
SCWCD : Servlet web applications : CHAP 3Ben Abdallah Helmi
 
Active server pages
Active server pagesActive server pages
Active server pagesmcatahir947
 
SCWCD : Servlet web applications : CHAP : 3
SCWCD : Servlet web applications : CHAP : 3SCWCD : Servlet web applications : CHAP : 3
SCWCD : Servlet web applications : CHAP : 3Ben Abdallah Helmi
 
C sharp and asp.net interview questions
C sharp and asp.net interview questionsC sharp and asp.net interview questions
C sharp and asp.net interview questionsAkhil Mittal
 
SynapseIndia dotnet development ajax client library
SynapseIndia dotnet development ajax client librarySynapseIndia dotnet development ajax client library
SynapseIndia dotnet development ajax client librarySynapseindiappsdevelopment
 
GWT Web Socket and data serialization
GWT Web Socket and data serializationGWT Web Socket and data serialization
GWT Web Socket and data serializationGWTcon
 
Web Technologies - forms and actions
Web Technologies -  forms and actionsWeb Technologies -  forms and actions
Web Technologies - forms and actionsAren Zomorodian
 

Similaire à Whats new in ASP.NET 4.0 (20)

ASP.NET Overview - Alvin Lau
ASP.NET Overview - Alvin LauASP.NET Overview - Alvin Lau
ASP.NET Overview - Alvin Lau
 
Spring WebApplication development
Spring WebApplication developmentSpring WebApplication development
Spring WebApplication development
 
State management in ASP.NET
State management in ASP.NETState management in ASP.NET
State management in ASP.NET
 
Asp.net
Asp.netAsp.net
Asp.net
 
nodejs_at_a_glance.ppt
nodejs_at_a_glance.pptnodejs_at_a_glance.ppt
nodejs_at_a_glance.ppt
 
SynapseIndia dotnet client library Development
SynapseIndia dotnet client library DevelopmentSynapseIndia dotnet client library Development
SynapseIndia dotnet client library Development
 
New Features Of ASP.Net 4 0
New Features Of ASP.Net 4 0New Features Of ASP.Net 4 0
New Features Of ASP.Net 4 0
 
Rich Portlet Development in uPortal
Rich Portlet Development in uPortalRich Portlet Development in uPortal
Rich Portlet Development in uPortal
 
Asp.Net Ajax Component Development
Asp.Net Ajax Component DevelopmentAsp.Net Ajax Component Development
Asp.Net Ajax Component Development
 
Multi Client Development with Spring
Multi Client Development with SpringMulti Client Development with Spring
Multi Client Development with Spring
 
2310 b 15
2310 b 152310 b 15
2310 b 15
 
2310 b 15
2310 b 152310 b 15
2310 b 15
 
SCWCD : Servlet web applications : CHAP 3
SCWCD : Servlet web applications : CHAP 3SCWCD : Servlet web applications : CHAP 3
SCWCD : Servlet web applications : CHAP 3
 
Active server pages
Active server pagesActive server pages
Active server pages
 
SCWCD : Servlet web applications : CHAP : 3
SCWCD : Servlet web applications : CHAP : 3SCWCD : Servlet web applications : CHAP : 3
SCWCD : Servlet web applications : CHAP : 3
 
C sharp and asp.net interview questions
C sharp and asp.net interview questionsC sharp and asp.net interview questions
C sharp and asp.net interview questions
 
SynapseIndia dotnet development ajax client library
SynapseIndia dotnet development ajax client librarySynapseIndia dotnet development ajax client library
SynapseIndia dotnet development ajax client library
 
GWT Web Socket and data serialization
GWT Web Socket and data serializationGWT Web Socket and data serialization
GWT Web Socket and data serialization
 
Web Technologies - forms and actions
Web Technologies -  forms and actionsWeb Technologies -  forms and actions
Web Technologies - forms and actions
 
Sun Web Server Brief
Sun Web Server BriefSun Web Server Brief
Sun Web Server Brief
 

Dernier

Man or Manufactured_ Redefining Humanity Through Biopunk Narratives.pptx
Man or Manufactured_ Redefining Humanity Through Biopunk Narratives.pptxMan or Manufactured_ Redefining Humanity Through Biopunk Narratives.pptx
Man or Manufactured_ Redefining Humanity Through Biopunk Narratives.pptxDhatriParmar
 
Unraveling Hypertext_ Analyzing Postmodern Elements in Literature.pptx
Unraveling Hypertext_ Analyzing  Postmodern Elements in  Literature.pptxUnraveling Hypertext_ Analyzing  Postmodern Elements in  Literature.pptx
Unraveling Hypertext_ Analyzing Postmodern Elements in Literature.pptxDhatriParmar
 
MS4 level being good citizen -imperative- (1) (1).pdf
MS4 level   being good citizen -imperative- (1) (1).pdfMS4 level   being good citizen -imperative- (1) (1).pdf
MS4 level being good citizen -imperative- (1) (1).pdfMr Bounab Samir
 
Expanded definition: technical and operational
Expanded definition: technical and operationalExpanded definition: technical and operational
Expanded definition: technical and operationalssuser3e220a
 
How to Fix XML SyntaxError in Odoo the 17
How to Fix XML SyntaxError in Odoo the 17How to Fix XML SyntaxError in Odoo the 17
How to Fix XML SyntaxError in Odoo the 17Celine George
 
BIOCHEMISTRY-CARBOHYDRATE METABOLISM CHAPTER 2.pptx
BIOCHEMISTRY-CARBOHYDRATE METABOLISM CHAPTER 2.pptxBIOCHEMISTRY-CARBOHYDRATE METABOLISM CHAPTER 2.pptx
BIOCHEMISTRY-CARBOHYDRATE METABOLISM CHAPTER 2.pptxSayali Powar
 
Blowin' in the Wind of Caste_ Bob Dylan's Song as a Catalyst for Social Justi...
Blowin' in the Wind of Caste_ Bob Dylan's Song as a Catalyst for Social Justi...Blowin' in the Wind of Caste_ Bob Dylan's Song as a Catalyst for Social Justi...
Blowin' in the Wind of Caste_ Bob Dylan's Song as a Catalyst for Social Justi...DhatriParmar
 
Grade Three -ELLNA-REVIEWER-ENGLISH.pptx
Grade Three -ELLNA-REVIEWER-ENGLISH.pptxGrade Three -ELLNA-REVIEWER-ENGLISH.pptx
Grade Three -ELLNA-REVIEWER-ENGLISH.pptxkarenfajardo43
 
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdfGrade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdfJemuel Francisco
 
Mental Health Awareness - a toolkit for supporting young minds
Mental Health Awareness - a toolkit for supporting young mindsMental Health Awareness - a toolkit for supporting young minds
Mental Health Awareness - a toolkit for supporting young mindsPooky Knightsmith
 
Reading and Writing Skills 11 quarter 4 melc 1
Reading and Writing Skills 11 quarter 4 melc 1Reading and Writing Skills 11 quarter 4 melc 1
Reading and Writing Skills 11 quarter 4 melc 1GloryAnnCastre1
 
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)lakshayb543
 
Q-Factor General Quiz-7th April 2024, Quiz Club NITW
Q-Factor General Quiz-7th April 2024, Quiz Club NITWQ-Factor General Quiz-7th April 2024, Quiz Club NITW
Q-Factor General Quiz-7th April 2024, Quiz Club NITWQuiz Club NITW
 
Oppenheimer Film Discussion for Philosophy and Film
Oppenheimer Film Discussion for Philosophy and FilmOppenheimer Film Discussion for Philosophy and Film
Oppenheimer Film Discussion for Philosophy and FilmStan Meyer
 
Concurrency Control in Database Management system
Concurrency Control in Database Management systemConcurrency Control in Database Management system
Concurrency Control in Database Management systemChristalin Nelson
 
Active Learning Strategies (in short ALS).pdf
Active Learning Strategies (in short ALS).pdfActive Learning Strategies (in short ALS).pdf
Active Learning Strategies (in short ALS).pdfPatidar M
 
Congestive Cardiac Failure..presentation
Congestive Cardiac Failure..presentationCongestive Cardiac Failure..presentation
Congestive Cardiac Failure..presentationdeepaannamalai16
 
ClimART Action | eTwinning Project
ClimART Action    |    eTwinning ProjectClimART Action    |    eTwinning Project
ClimART Action | eTwinning Projectjordimapav
 
Daily Lesson Plan in Mathematics Quarter 4
Daily Lesson Plan in Mathematics Quarter 4Daily Lesson Plan in Mathematics Quarter 4
Daily Lesson Plan in Mathematics Quarter 4JOYLYNSAMANIEGO
 

Dernier (20)

prashanth updated resume 2024 for Teaching Profession
prashanth updated resume 2024 for Teaching Professionprashanth updated resume 2024 for Teaching Profession
prashanth updated resume 2024 for Teaching Profession
 
Man or Manufactured_ Redefining Humanity Through Biopunk Narratives.pptx
Man or Manufactured_ Redefining Humanity Through Biopunk Narratives.pptxMan or Manufactured_ Redefining Humanity Through Biopunk Narratives.pptx
Man or Manufactured_ Redefining Humanity Through Biopunk Narratives.pptx
 
Unraveling Hypertext_ Analyzing Postmodern Elements in Literature.pptx
Unraveling Hypertext_ Analyzing  Postmodern Elements in  Literature.pptxUnraveling Hypertext_ Analyzing  Postmodern Elements in  Literature.pptx
Unraveling Hypertext_ Analyzing Postmodern Elements in Literature.pptx
 
MS4 level being good citizen -imperative- (1) (1).pdf
MS4 level   being good citizen -imperative- (1) (1).pdfMS4 level   being good citizen -imperative- (1) (1).pdf
MS4 level being good citizen -imperative- (1) (1).pdf
 
Expanded definition: technical and operational
Expanded definition: technical and operationalExpanded definition: technical and operational
Expanded definition: technical and operational
 
How to Fix XML SyntaxError in Odoo the 17
How to Fix XML SyntaxError in Odoo the 17How to Fix XML SyntaxError in Odoo the 17
How to Fix XML SyntaxError in Odoo the 17
 
BIOCHEMISTRY-CARBOHYDRATE METABOLISM CHAPTER 2.pptx
BIOCHEMISTRY-CARBOHYDRATE METABOLISM CHAPTER 2.pptxBIOCHEMISTRY-CARBOHYDRATE METABOLISM CHAPTER 2.pptx
BIOCHEMISTRY-CARBOHYDRATE METABOLISM CHAPTER 2.pptx
 
Blowin' in the Wind of Caste_ Bob Dylan's Song as a Catalyst for Social Justi...
Blowin' in the Wind of Caste_ Bob Dylan's Song as a Catalyst for Social Justi...Blowin' in the Wind of Caste_ Bob Dylan's Song as a Catalyst for Social Justi...
Blowin' in the Wind of Caste_ Bob Dylan's Song as a Catalyst for Social Justi...
 
Grade Three -ELLNA-REVIEWER-ENGLISH.pptx
Grade Three -ELLNA-REVIEWER-ENGLISH.pptxGrade Three -ELLNA-REVIEWER-ENGLISH.pptx
Grade Three -ELLNA-REVIEWER-ENGLISH.pptx
 
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdfGrade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
 
Mental Health Awareness - a toolkit for supporting young minds
Mental Health Awareness - a toolkit for supporting young mindsMental Health Awareness - a toolkit for supporting young minds
Mental Health Awareness - a toolkit for supporting young minds
 
Reading and Writing Skills 11 quarter 4 melc 1
Reading and Writing Skills 11 quarter 4 melc 1Reading and Writing Skills 11 quarter 4 melc 1
Reading and Writing Skills 11 quarter 4 melc 1
 
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
 
Q-Factor General Quiz-7th April 2024, Quiz Club NITW
Q-Factor General Quiz-7th April 2024, Quiz Club NITWQ-Factor General Quiz-7th April 2024, Quiz Club NITW
Q-Factor General Quiz-7th April 2024, Quiz Club NITW
 
Oppenheimer Film Discussion for Philosophy and Film
Oppenheimer Film Discussion for Philosophy and FilmOppenheimer Film Discussion for Philosophy and Film
Oppenheimer Film Discussion for Philosophy and Film
 
Concurrency Control in Database Management system
Concurrency Control in Database Management systemConcurrency Control in Database Management system
Concurrency Control in Database Management system
 
Active Learning Strategies (in short ALS).pdf
Active Learning Strategies (in short ALS).pdfActive Learning Strategies (in short ALS).pdf
Active Learning Strategies (in short ALS).pdf
 
Congestive Cardiac Failure..presentation
Congestive Cardiac Failure..presentationCongestive Cardiac Failure..presentation
Congestive Cardiac Failure..presentation
 
ClimART Action | eTwinning Project
ClimART Action    |    eTwinning ProjectClimART Action    |    eTwinning Project
ClimART Action | eTwinning Project
 
Daily Lesson Plan in Mathematics Quarter 4
Daily Lesson Plan in Mathematics Quarter 4Daily Lesson Plan in Mathematics Quarter 4
Daily Lesson Plan in Mathematics Quarter 4
 

Whats new in ASP.NET 4.0

  • 1. What's new in ASP.NET 4.0 Quick Overview of Important Features Sunil Pottumuttu
  • 2. ASP.NET 3.5 Service Pack 1 Microsoft Entity Framework ADO.NET Data Services Dynamic Data
  • 3. Overview of Talk ASP.NET supports several very different types of web applications
  • 4. Web.config File Refactoring <?xml version="1.0"?> <configuration> <system.web> <compilation targetFramework="4.0" /> </system.web> </configuration>
  • 5. Extensible Output Caching ASP.NET 4.0 OutputCacheProvider - create a custom output- cache provider as a class that derives from the new System.Web.Caching.OutputCacheProvider Providers for 3rd Party, Velocity, FileSystem
  • 6. Output Caching Configuration <caching> <outputCache defaultProvider="AspNetInternalProvider"> <providers> <add name="DiskCache" type="Test.OutputCacheEx.DiskOutputCacheProvider, DiskCacheProvider"/> </providers> </outputCache> </caching>
  • 7. Output Caching Configuration at Page Level <%@ OutputCache Duration="60" VaryByParam="None" providerName="DiskCache" %>
  • 8. Auto-Start Web Applications Usual approach: Application_Start Auto-Start ASP.NET 4.0 + IIS 7.5 AppPool startMode set to “alwaysRunning” IIS Application Warm-Up Module for IIS 7.5 warm-up occurs during startup of the IIS service (if you configured the IIS application pool as AlwaysRunning) and when an IIS worker process recycles. During recycle, the old IIS worker process continues to execute requests until the newly spawned worker process is fully warmed up, so that applications experience no interruptions or other issues due to unprimed caches
  • 9. IIS Configuration for the above In applicationHost.config <applicationPools> <add name="MyApplicationPool" startMode="AlwaysRunning" /> </applicationPools>
  • 10. Permanently Redirecting a Page RedirectPermanent("/newpath/foroldcontent.aspx");
  • 11. Session State Compression Used when state is out of porcess compressionEnabled in web.config DeflateStream/GZipStream Use System.IO.Compression.GZipStream Web.config <sessionState mode="SqlServer" sqlConnectionString="data source=dbserver;Initial Catalog=aspnetstate" allowCustomSqlDatabase="true" compressionEnabled="true“ />
  • 12. Expanding the Range of Allowable URLs Previous versions of ASP.NET constrained URL path lengths to 260 characters, based on the NTFS file-path limit. <httpRuntime maxRequestPathLength="260" maxQueryStringLength="2048" />
  • 13. Request Path Valid Chars 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 <httpRuntime requestPathInvalidChars="&lt;,&gt;,*,%,&amp;,:,,?" /> By default, the requestPathInvalidChars attribute defines eight characters as invalid. (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.) You can customize the set of invalid characters as needed
  • 14. Extensible Request Validation System.Web.Util.RequestValidator <httpRuntime requestValidationType="Samples.MyValidator, Samples" /> public class CustomRequestValidation : RequestValidator { protected override bool IsValidRequestString( HttpContext context, string value, RequestValidationSource requestValidationSource, string collectionKey, out int validationFailureIndex) {...} }
  • 15. Object Caching and Object Caching Extensibility System.Runtime.Caching.dll Can Implement MemoryCache
  • 16. Extensible HTML, URL, and HTTP Header Encoding <httpRuntime encoderType="Samples.MyCustomEnco der, Samples" /> You can create a custom encoder by deriving from the new System.Web.Util.HttpEncoder After a custom encoder has been configured, ASP.NET automatically calls the custom encoding implementation whenever public encoding methods of the System.Web.HttpUtility or System.Web.HttpServerUtility classes are called
  • 18. jQuery Included with Web Forms and MVC jQuery-1.4.1.js – The human-readable, unminified version of the jQuery library. jQuery-14.1.min.js – The minified version of the jQuery library. jQuery-1.4.1-vsdoc.js – The Intellisense documentation file for the jQuery library.
  • 19. Content Delivery Network Support <script src="http://ajax.microsoft.com/ajax/jquery/jquery- 1.4.2.js" type="text/javascript"></script> Supports SSL More Details here: http://www.asp.net/ajaxlibrary/CDN.ashx ASP.NET ScriptManager supports the Microsoft Ajax CDN <asp:ScriptManager ID="sm1" EnableCdn="true" runat="server" />
  • 20. ScriptManager Explicit Scripts <asp:ScriptManager ID="sm1" AjaxFrameworkMode="Explicit" runat="server"> <Scripts> <asp:ScriptReference Name="MicrosoftAjaxCore.js" /> <asp:ScriptReference Name="MicrosoftAjaxComponentModel.js" /> <asp:ScriptReference Name="MicrosoftAjaxSerialization.js" /> <asp:ScriptReference Name="MicrosoftAjaxNetwork.js" /> </Scripts> </asp:ScriptManager> ** ScriptManager.AjaxFrameworkMode
  • 21. Setting Meta Tags Page.MetaKeywords and Page.MetaDescription Properties of Page class <meta name="keywords" content="These, are, my, keywords" /> <meta name="description" content="This is the description of my page" /> OR <%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" Keywords="These, are, my, keywords" Description="This is a description" %>
  • 22. Enabling View State for Individual Controls ViewStateMode Property Enabled Disabled Inherit Enabled enables view state for that control and for any child controls that are set to Inherit or that have nothing set. Disabled disables view state, and Inherit specifies that the control uses the ViewStateMode setting from the parent control
  • 23. ASP.NET Core Enhancements Cache Extensibility Auto-Start Web Applications Browser Capabilities Extensibility Session State Compression
  • 24. ASP.NET Core Enhancements Cache Extensibility Auto-Start Web Applications Browser Capabilities Extensibility Session State Compression
  • 25. Browser Definition Files blackberry.browser chrome.browser Default.browser firefox.browser gateway.browser generic.browser ie.browser iemobile.browser iphone.browser opera.browser safari.browser
  • 26. Routing in ASP.NET 4 public class Global : System.Web.HttpApplication { void Application_Start(object sender, EventArgs e) { RouteTable.Routes.MapPageRoute("SearchRoute", "search/{searchterm}", "~/search.aspx"); RouteTable.Routes.MapPageRoute("UserRoute", "users/{username}", "~/users.aspx"); } } Equivalent asp.net 4 RouteTable.Routes.Add("SearchRoute", new Route("search/{searchterm}", new PageRouteHandler("~/search.aspx"))); string searchterm = Page.RouteData.Values["searchterm"] as string;
  • 27. Accessing Routing Information in Markup <asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl="<%$RouteUrl:SearchTerm=scott%>"> Search for Scott</asp:HyperLink>
  • 28. Setting Client IDs Predictable Client ID’s <%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" ClientIDMode="Predictable" %> OR <system.web> <pages clientIDMode="Predictable"></pages> </system.web>
  • 29. Chart Control 35 distinct chart types. An unlimited number of chart areas, titles, legends, and annotations. A wide variety of appearance settings for all chart elements. 3-D support for most chart types. More than 50 financial and statistical formulas for data analysis and transformation. State management. Binary streaming.
  • 30. New Syntax for HTML Encoded Expressions Old Style <%= HttpUtility.HtmlEncode(expression) %> New style <%: expression %>
  • 31. Project Template Changes Web Site project or Web Application project
  • 33. Web Application and Web Site Project Templates
  • 34. Dynamic Data •RAD experience for quickly building a data-driven Web site. •Automatic validation that is based on constraints defined in the data model. •The ability to easily change the markup that is generated for fields in the GridView and DetailsView controls by using field templates that are part of your Dynamic Data project.