Академический Документы
Профессиональный Документы
Культура Документы
ASP.NET 1.1 to
ASP.NET 2.0
David Webster
EMEA Technical Team Microsoft
Email: davidjw@microsoft.com
Agenda
• <xhtml11Conformance
enableLegacyRendering=“true” />
– Web.config file setting to use older HTML markup rendering
– Set this to help with migration of existing sites
– Recommend updating pages to be XHTML compliant long-
term
ASP.NET 1.X to ASP.NET 2.0
• Key Benefits:
– No more project file required
– Web projects no longer compiled into single DLL
– Web projects can now be written in multiple languages
– No need to re-compile project when making changes
– Ability to update pages/code while using the debugger
– Significantly cleaner and more robust code-behind model
Visual Studio Conversion
• Syntax differences:
– ASP.NET 1.1 page definition
• <%@ page codeBehind=“webform1.aspx.cs” inherits=“WebForm1” %>
– ASP.NET 1.1 code-behind class definition
• public class WebForm1 : System.Web.UI.Page
– ASP.NET 2.0 page definition
• <%@ page codeFile=“webform1.aspx.cs” inherits=“WebForm1” %>
– ASP.NET 2.0 code-behind class definition
• public partial class WebForm1 : System.Web.UI.Page
ASP.NET 2.0 Code-behind
File containing code Class that the page-gen
behind inherits from
class definition
Default.aspx
Default.aspx.cs
Class is ‘partial’ and is combined Base class. Can be defined by user. The
to an auto-generated partial required ancestor base class is
class System.Web.UI.Page
Dynamic Compile
• VS 2005 auto upgrades existing web projects to use new project model
– Provides significantly better flexibility for web projects
– Need to be aware of a few implications of dynamic compilation model
• Request prioritization
– New “requestPriority” attribute on <httpRuntime>
– Can set per vdir using <location> tags
– Can group sets of pages into directories according to desired
priority
• “Critical” pages will always be queued for execution
– “High” priority pages execute before “Normal” priority pages
– “Normal” is the default priority
ASP.NET 2.0 Runtime
• Buffered Uploads
– Handles large file uploads
– Large SOAP headers when calling .asmx pages
– Large Http requests
• New attribute “requestLengthDiskThreshold” on
<httpRuntime>
– If request length exceeds limit (256Kb default), content is
spooled to disk
– Minimizes memory overhead for concurrent large requests
ASP.NET 2.0 Runtime
• Protected Configuration
– Allows any configuration section in ASP.NET 2.0 to be
encrypted
– Built-in support for RSA and DPAPI
• Extensible support allows custom encryption with
custom providers
– A custom protected configuration provider does not
necessarily need to “encrypt” anything
• Could instead load configuration information from an off-
the-box location
ASP.NET 2.0 Runtime
• Health Monitoring
– Built-in support for logging various event information and
errors to providers
– Can store event information in different data stores with
custom providers
– ASP.NET 2.0 automatically logs errors to the event log
• Comprehensive information for tracking down problems on
production servers where debug access is usually not
available
• Look at Health Monitoring before writing a custom
event infrastructure
Demonstration Six
Health Monitoring – Event Log Entries
Providers
Database
Site Management
Caching
Navigation
Providers
Database
Site Management
Caching
Navigation
Providers