Добавил:
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Build Your Own ASP.NET 2.0 Web Site Using CSharp And VB (2006) [eng]-1.pdf
Скачиваний:
144
Добавлен:
16.08.2013
Размер:
15.69 Mб
Скачать

Chapter 5: Building Web Applications

Specialized exception classes can contain additional members. For example, the SqlException class, which is raised when database-related errors occur, includes a collection of error messages (SqlError objects) in its Errors property. You could use a For-Each loop to iterate through these errors.

In complex application scenarios, you could even create your own exception classes as specialized versions of Exception. You could then throw these exceptions as needed, and catch them in a class or method that is situated in the upper levels of the hierarchy, and will handle these errors properly.

Summary

In this chapter, you’ve learned just how powerful Visual Web Developer can be. We’ve seen most of its basic features in action, and we’ve experimented with some of the really useful features you’ll find yourself using every day, such as automatic code generation and debugging.

We’ve taken a close look at Web.config, which is where your web application’s configuration settings will be stored, and Global.asax, which is where applicationwide events can be handled. We’ve also discussed the Application and Cache objects, which can be used to store data that’s available to all pages within an application; the Session object, which can be used to store user-specific data across requests; and cookies, which can be sent to the user’s browser, then read on subsequent visits.

Finally, we took a look at themes and master pages, which are powerful ways of managing your site’s look and feel.

In Chapter 6, we’ll discuss data validation, and learn how ASP.NET’s validation controls can help us ensure that our back-end systems are as secure as possible.

218