Docstoc

ASPNet 4 - What’s in it for me

Document Sample
ASPNet 4 - What’s in it for me Powered By Docstoc
					ASP.Net 4 - What’s in it for me?

Noam King
CTO Sela College
http://blogs.microsoft.co.il/blogs/noam
Agenda
•   VS2010 for Web
•   ASP.NET 4 Core Services
•   ASP.NET 4 Web Applications
•   ASP.NET 4 Deployment
•   Web it all up – What should I choose?
•   Q & A + Summary
VS2010 For Web Developers
• Improved CSS Compatibility using CSS 2.1
• HTML and Jscript Snippets
• Jscript intellisense Enhancements

• Quick Search (Navigate To..)
• Call Hierarchy
• Consume First + Generation
Clean HTML
<asp:Menu runat="server">
  <Items>
     <asp:MenuItem Text=“Home"NavigateUrl="~/Home.aspx">
                                 NavigateUrl="~/about.aspx" />
        <asp:MenuItem Text=“About"
     </asp:MenuItem>
     <asp:MenuItem Text=“Products"NavigateUrl="~/Products.aspx" />
     <asp:MenuItem Text=“Categories"NavigateUrl="~/Categories.aspx" />
     <asp:MenuItem Text=“Admin"NavigateUrl="~/Admin.aspx" />
   </Items>
</asp:Menu>



<asp:FormView
        ID="Formview1"
        RenderTable="false"
        runat="server">
VS2010 IDE
Caching
• New provider extensibility point
  • Customizable persistence mechanism for:
     • Control output caching
     • Page (aka HttpResponse) output caching
• Supports
  • Absolute expiration
  • File dependencies
  • Static substitution and validation callbacks
• Windows AppFabric Caching & disk based
  providers planned for post-RTM
Extensible Output Caching
• Configure one or more custom output-
  cache providers
• More aggressive and more intelligent
  output-caching strategies for your Web
  sites
<caching>
  <outputCache defaultProvider="AspNetInternalProvider">
    <providers>
      <add name="DiskCache"
          type="Test.OutputCacheEx.DiskOutputCacheProvider, 
                                  DiskCacheProvider"/>
    </providers>
  </outputCache>
</caching>
Shrinking Session State
• New compression option for both kinds
  of out-of-process session-state
  providers(State service, MSSQL).
• Using behind the scene, the .NET
  Framework
  System.IO.Compression.GZipStream class
<sessionState
    mode="SqlServer"
    sqlConnectionString="data source=dbserver;Initial Catalog=aspnetstate"
    allowCustomSqlDatabase="true"
    compressionEnabled="true"
/>
Performance Monitoring
• More granular view into the resource
  consumption
  • % Managed Processor Time
  • Managed Memory Used
(in aspnet.config)
<?xml version="1.0" encoding="UTF-8" ?>
<configuration>
  <runtime>
    <appDomainResourceMonitoring enabled="true"/>
  </runtime>
</configuration>
Better StartUp options
• Service auto-start integration for non-http
  applications
• IIS team created an application warm-up
  module
  • Built on top of IIS 7.5’s auto-start feature
  • Works with any ASP.NET version
  •
Auto-Start Web Applications
• Use with IIS 7.5
• PreloadProvider using
  System.Web.Hosting.IProcessHostPreloa
  dClient
     }
public class CustomInitialization : 
                                               In applicationHost.config
System.Web.Hosting.IProcessHostPreloadClie
                                               <applicationPools> 
nt
                                                           <add 
{                                                          name="MyApplicationPool" 
    public void Preload(string[] parameters)               startMode="AlwaysRunning"    /> 
    {                                          </applicationPools>
        // Perform initialization.
    }
}
ASP.NET Core Services
ViewState for Individual Controls
• <Control>.ViewStateMode
  • Enabled (default value)
  • Disabled
  • Inherit
• Can be specified separately for each
  control
• Can be forced on all control at the Page
  Directive
Client IDs
• At last, Controlling the generated Client
  id’s
  • ClientIDMode
    • AutoID – Auto Generated by ASP.NET.
    • Static – Fixed ID
    • Predictable – Usually for repeating template
      control, generally controlled via
      ClientIDRowSuffix to be a unique value
    • Inherit –default behavior
Routing
• Simple Urls and SEO optimizations
• Can specify rules for URL structure
• Reading the values from a Web Form,
  Accessing in Markup and specify a
  routeparameter in Binding
Page.RouteData.Values["searchterm"] as string;
----------------------------------------------
<asp:HyperLink ID="HyperLink1" runat="server“     
NavigateUrl="<%$RouteUrl:SearchTerm=yosi%>">Search for Yosi</asp:HyperLink>
----------------------------------------------
<asp:sqldatasource id="SqlDataSource1" runat="server“…. 
<selectparameters><asp:routeparameter name="companyname" 
RouteKey="searchterm" />…
Meta Tags
• Feature for Search Engine Optimize (SEO)
• Allow set page meta tags
  • keywords
  • Description
<%@ Page Language="C#" AutoEventWireup="true"  
    CodeFile="Default.aspx.cs"
    Inherits="_Default"
    Keywords="These, are, my, keywords"
    Description="This is a description" %>
Other SEO Improvements
• New
  Response.Redirect()
  methods:
  • Response.RedirectP
    ermanent(newUrl)
  • Response.RedirectTo
    Route(routeName)

• SEO Toolkit
QueryExtender Control
                                                                        • Search
• Works with LinqDataSource and                                         • Range
                                                                        • Property
  EntityDataSource                                                      • Custom

• Helps in filtering database results
• Using different kind of expressions:
<asp:LinqDataSource ID="dataSource" runat="server"> TableName="Products">
</asp:LinqDataSource>
<asp:QueryExtender TargetControlID="dataSource" runat="server">
  <asp:PropertyExpression>
    <asp:ControlParameter ControlID="CheckBoxDiscontinued" Name="Discontinued" />
  </asp:PropertyExpression>
</asp:QueryExtender>
ASP.NET Chart Control
• Built-into ASP.NET 4.0
ASP.NET 4.0 Web Forms
Web Packaging
• Web Packaging - Packaging your web applications
  into .zip files
• Web.Config Transformation - Transforming your
  web.config file (i.e. connection string, debug flags
  etc) from dev environment to production
  environment
• DB Deployment - Packaging and deploying your SQL
  Server databases along with your web application
• Web Publishing - Using Web 1-Click Publish
  functionality to deploy your web application with
  ease.
ASP.NET 4.0 Deployment
Web it all up – What should I
Choose?                      Silverlight


                                      .NET for Silverlight
       ASP.NET          ASP.NET
         Ajax         Dynamic Data          XAML
                                      Presentation Core



      ASP.NET              ASP.NET   Browser Host
      WebForms               MVC




                 ASP.NET
                   Core
The Web Developers Community
(WDC)
WEB DEVLOPERS COMMUNITY       (WDC)
• New Technologies
• Architecture
• Legacy Systems
• Data
• Traffic & Maintenance JOIN W
                               DC !!
• New Languages
• Community Driven
 Every First Sunday of Any Month
Summary
• ASP.NET 4 :
  •   More Control
  •   Better Choices
  •   Maintainable Deployment
  •   Faster Coding Experience
Additional Resources
• Official sites
   • Central landing site:

				
DOCUMENT INFO
Shared By:
Categories:
Tags:
Stats:
views:4
posted:7/12/2013
language:Latin
pages:28
Jun Wang Jun Wang Dr
About Some of Those documents come from internet for research purpose,if you have the copyrights of one of them,tell me by mail vixychina@gmail.com.Thank you!