If you use one server to develop your applications and another to deploy them, you probably have to change your database connection settings each time you deploy your configuration files. Learn a quick fix for this problem.
More articles by Eric Smith
In development scenarios where you make multiple changes to the database, consider using transactions and, optionally, nesting transactions.
One of the many new libraries included with .NET 2.0 allows for compression and decompression of files using the gzip file format. Find out how to use it.
Tracing down errors in web applications and services is no easy task. To make it simpler, learn how to add trace statements to your code. They appear only when tracing is enabled on the web page or the web site.
If you use a return statement within a Try/Catch block, there's a behavior you need to be aware of in your code.
ASP.NET 2.0 enables you to encrypt portions of your configuration file. You can pick a section in your Web.config file to encrypt and then decrypt.
Learn a nice, easy drop-in solution that helps your web site users log in and out without seeing the "artifacts" that you may have run into during previous implementations of your security code.
Prior to ASP.NET 2.0, some HTML controls had ASP.NET equivalents and others didn't. ASP.NET 2.0 rectifies this inconsistency with the new FileUpload control.
The LoginView control added to ASP.NET 2.0 can replace some of the tedious code you've probably got in your ASP.NET 1.x applications.
A number of "low-tech" approaches for implementing security around your Web services don't involve a lot of extra coding.
The generic collection introduced with .NET 2.0 allows you to create collections of your objects without having to design a new class.
The .NET Framework's built-in comparison functions don't handle nulls properly. Learn a couple of functions to take care of this for you.
How do I implement paging within a Repeater control, you ask? Simple: Roll your own paging solution.
If you have a Web-based application that doesn't support Web services, you perform "webscraping": a Web-based screen scraping using the HttpWebRequest and HttpWebResponse objects.
Web servers sometimes produce a Web page even if it has an error. To verify whether the server is actually running and not generating any Web errors, use the HttpWebRequest class to check the content of any ASP.NET page.
The TcpClient class enables you to test whether services such as FTP and SMTP/POP3 mail are running and responding properly.
By using the Ping class, one of the many classes included in the .NET Framework Library, you can create a simple server monitor that ensures your servers are all responding to network traffic.
Under ASP.NET 1.x, the built-in FormsAuthentication method enabled persistent logins easily, but ASP.NET 2.0 has changed how the forms authentication tickets work.
The new System.Net.Mail library in ASP.NET 2.0 introduces some useful features, but it also includes bugs. Find out how they come into play when you send mail.
Sure, you can bind database-related objects to grids and repeaters, but what about binding your own objects to grids and lists? Learn how to build a class that can be bound to a Repeater without involving any databases.
Although easy to create, user controls are harder to share between projects. As an alternative, you can create a composite control, which is harder to create, but much easier to share between applications.
Atom, the replacement for RSS, is quickly being adopted by many blogging software makers. Learn how to produce an Atom XML feed using a database table.
Password security is an easy way to tighten access to any application. Use this function to check a password against a set of rules, as well as a set of previously used passwords.
Enable your users to download data for use in Excel spreadsheets with a few easy tricks that leave all the hard formatting work to Excel.
Want to make managing the sequence of events within a Web page easier? Simply register for a custom event and run your code when the event occurs.
The nested master page is a great way to manage the layout of your Web site without duplicating content on every page.
Enable your Web application to select a master page dynamically at runtime based on whatever criteria you choose.
Learn a method for controlling how users download files from your ASP.NET applications.
When you create a PlaceHolder control, an empty container to which you can add your controls, ASP.NET will remember the values for your dynamic controls and repopulate the data automatically.
System event logs can provide valuable information, but manually finding the worthwhile details in them can be difficult. Learn the easy, automated ways .NET provides for reading and searching event logs.
Sometimes you need to vary the number and configuration of your controls to control the layout of your input forms. Learn how to set various attributes on the controls.
The system event log is a good place to store information about your .NET application, and writing entries to the event log is fairly straightforward. You can easily add the code for it to a utility class.
An outdated page footer can give the impression that your site is stale. With just a little HTML and code-behind, you can keep your footer perpetually current.
Employ this function in your e-commerce application to validate the credit card numbers your users enter.
Creating a custom configuration section in your configuration class will make it more modular and not reliant on the generic appSettings section in the configuration file.
Overloading the constructor of a class, which is the method called when you instantiate an object, ensures that your object is populated with all the information it needs to operate properly.
When you're creating a function that needs a variable list of arguments, use a parameter array.
The .NET Framework 2.0 gets very fussy when you try to run both ASP.NET 1.1 and ASP.NET 2.0 sites in the same application pool. Learn how to support both versions on the same Windows 2003 machine.
Learn how to work with the fields and data within ASP.NET's Repeater control using the ItemDataBound event. This feature enables you to perform a variety of useful functions.
The Repeater control, like other ASP.NET data-bound controls, contains events to help you respond to the actions a user performs on controls within the Repeater. Learn how to respond to the ItemCommand event.
By creating smart properties to instantiate your objects, you can keep a single instance of an object without worrying about whether the object has been instantiated yet.
The ViewState used in ASP.NET provides a cleaner way to pass your own information while your page is running. Learn how it works.
Creating a shared Page class from which all your Web pages inherit allows the pages to share common functions, settings, and so forth without having to do much work.