as you can see, the new code-behind file is much cleaner and easier to read. The code-behind file has automatic access to any controls added to the ASP.NET page, and Visual Studio 2005 will provide automatic IntelliSense support and synchronization. Visual Studio also recognizes when you are using a code-behind file, and opens the file rather than the code view when you double-click on a control to access its events.
the final major change to the coding model is a direct response to a common problem in ASP.NET. Most Web applications require one or more support classes. In ASP.NET, the preferred method was to create a separate project for support classes and then add a reference to the support project within your Web application. Even if you didn''t create a separate project, you still had to create a reference to whatever namespace you used within your own application. Although having a separate project made sense for larger and more complicated applications, it was often painful for developers who only needed one or two simple classes.
asp.net 2.0 introduces a new way of adding support code. The /code directory is a special directory that is automatically compiled and referenced by your ASP.NET application. That is, any classes you place inside the /code directory are automatically accessible from any ASPX page in your application. Visual Studio 2005 and the ASP.NET compiler both automatically create an assembly from these classes and place a reference to the assembly in your Web application.
one of the more difficult challenges as an ASP.NET developer was properly configuring the web.config file. In ASP.NET 2.0 and Visual Studio 2005, you now have several new features to help you with this task.
first, Visual Studio''s IntelliSense feature has now been extended to any XML file that has a valid schema. In the case of the web.config file, this means that you get full IntelliSense support whenever you edit the web.config file from within Visual Studio.
figure 4. IntelliSense on web.config
intellisense helps reduce the chance of misconfigured files. However, ASP.NET 2.0 also includes a new administrative Web site and a Microsoft Management Console to make things even easier.
to simplify the process of managing users, ASP.NET 2.0 provides a built in Web site configuration tool. The Web Site Administration Tool is a simple Web site that can only be accessed through a secure connection, or directly on the local host. Through this tool, an administrator can manage the application by configuring services such as user management, the personalization providers, security, and profiles. The tool also allows you to easily configure counters, debugging, and tracing information for your application.
figure 5. Web site administration tool
asp.net 2.0 deploys a special Micro