Skip to Main 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 content levelIntermediate 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.
Start your free trial

You might also like

Jumping from ASP to ASP.NET

Jumping from ASP to ASP.NET

Doug Parsons

Publisher Resources

ISBN: 0596008120Supplemental ContentErrata Page