Skip to Content
Beginning ASP.NET 3.5: In C# and VB
book

Beginning ASP.NET 3.5: In C# and VB

by Imar Spaanjaars
March 2008
Intermediate to advanced content levelIntermediate to advanced
766 pages
21h 15m
English
Wrox
Content preview from Beginning ASP.NET 3.5: In C# and VB

18.1. Preparing Your Web Site for Deployment

When you're working on the first edition of your web site in a development environment, managing the site and its source code is pretty straightforward. You only have a single version of the site's source, making it easy to maintain. However, as soon as you put your site in production, you now have two versions of the site: one running in the production environment and the one you use for development. This makes it difficult to keep things synchronized. For example, you probably use a different database and connection string in your production environment. You're also likely to use different e-mail addresses for the e-mail that is sent by the site. Finally, you may want to disable sending the error e-mails from the Global.asax files in a development environment. If you make all of these changes in the code directly when you put your site live, there's a fair chance that you'll overwrite some settings during the next update, which can lead to unwanted results.

This section shows you how to make managing different versions of the same web site a little easier. You see how to move some of the hardcoded settings, like e-mail addresses, to the web.config file. The code in your application then reads these values at run time. The only difference between your development and production environments is a single configuration file, making it easy to have different settings in both environments.

18.1.1. Avoiding Hardcoded Settings

So far the ...

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

Beginning ASP.NET 4: in C# and VB

Beginning ASP.NET 4: in C# and VB

Imar Spaanjaars
Professional ASP.NET 3.5 SP1 Edition: In C# and VB

Professional ASP.NET 3.5 SP1 Edition: In C# and VB

Bill Evjen, Scott Hanselman, Devin Rader

Publisher Resources

ISBN: 9780470187593Purchase book