Skip to Content
ASP.NET 2.0: A Developer's Notebook
book

ASP.NET 2.0: A Developer's Notebook

by Wei-Meng Lee
June 2005
Intermediate to advanced
348 pages
7h 40m
English
O'Reilly Media, Inc.
Content preview from ASP.NET 2.0: A Developer's Notebook

Chapter 6. Performance

ASP.NET 2.0 includes new features that enhance the performance of your web applications. For example, in ASP.NET 1.x, pages are dynamically compiled and cached the first time a user loads a page. As a result, an ASP.NET 1.x web application is typically slower the first time it is loaded. In ASP.NET 2.0, you can now precompile your site so that it’s already compiled when the first user pays a visit.

Note

You can now make changes to your ASP.NET 2.0 web application and it will recompile on the fly.

In ASP.NET 1.x, all code-behinds are compiled into an assembly and stored in the /bin directory of the application, while the web pages (.aspx) are compiled on demand. And so any changes made to the .aspx page will automatically be updated, whereas changes to the code-behind of the page will not be recompiled until you explicitly request it.

In ASP.NET 2.0, you can use dynamic runtime compilation so that any changes made to either the .aspx or .vb (or .cs) files will automatically trigger a recompilation of the page.

How do I do that?

To verify that ASP.NET 2.0 will dynamically recompile your .aspx and code-behind files, you will create a web application that uses a class stored in a special directory called App_Code. When the class stored in the App_Code folder is modified, ASP.NET 2.0 will automatically recompile it when the page is requested.

  1. Launch Visual Studio 2005 and create a new web site project. Name the project C:\ASPNET20\chap06-DynamicRecompilation.

  2. To use ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

Jumping from ASP to ASP.NET

Jumping from ASP to ASP.NET

Doug Parsons
Professional ASP.NET MVC 4

Professional ASP.NET MVC 4

Jon Galloway, Phil Haack, Brad Wilson, K. Scott Allen, Scott Hanselman

Publisher Resources

ISBN: 0596008120Errata Page