O'Reilly logo

ASP.NET 2.0: A Developer's Notebook by Wei-Meng Lee

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Precompile Your Site

In ASP.NET 1.x, you deploy files with .aspx extensions to the web server that hosts the application. To safeguard your business logic, ASP.NET does not require you to deploy the code-behinds of your Web Forms. However, the user interface of your web application is still encapsulated within the .aspx file, and these files must be deployed to the web server, opening the possibility that someone at the web server end (especially for web hosting scenarios) may read your UI code. ASP.NET 2.0 has gone a step further, allowing you to precompile a site so that when you deploy it:

Note

You can now precompile and deploy your ASP.NET web application without exposing the source, thereby improving first user response time and protecting your IP.

  • There is no code (neither .aspx nor code-behind sources) on the server side.

  • The site is precompiled, which shortens first-use response time.

Tip

If your web application uses client-side scripts, they would still be visible on the user's web browser side, since they have to be sent to the web browser for processing.

How do I do that?

ASP.NET 2.0 supports two precompilation options:

  • Precompile for site deployment

  • Precompile In-Place

Precompile for site deployment allows to you to deploy the compiled binaries of your web site to the hosting machine without the need to deploy your source code. This is a great boost to protecting your source, especially when you are deploying to a remote hosting machine and do not want others to see the source ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required