Добавил:
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
ASP .NET 2.0 Beta Preview - B. Evjen.pdf
Скачиваний:
26
Добавлен:
24.05.2014
Размер:
15.33 Mб
Скачать

Visual Studio 2005

Figure 2-6

Error notifications and assistance

In previous versions of Visual Studio, design-time error checking was a great feature of the IDE. As you typed your code, Visual Studio checked the code for errors. For instance, if you wrote an If Then statement (in Visual Basic) that didn’t include an End If statement, the IDE would underline the If Then statement to remind you that the block of code was not complete. The line disappeared after you corrected the error. With Visual Studio 2005, if you make any design-time errors, a small square appears to the right of the underline (as shown under the n in Then in Figure 2-7).

Figure 2-7

Hovering your cursor over the square causes an error sign to appear. Clicking the error sign opens up a dialog that gives you options for fixing the error. For example, if you are using an If Then statement without the closing End If statement in Visual Basic, clicking the error notification button provides you with a fix from the IDE, as shown in Figure 2-8.

27

Chapter 2

Figure 2-8

This pop-up dialog first states the issue. In this case, it says that any opening If statement must include a closing End If statement. Below this error notification is a link that enables you to apply the fix. Below the link is a code sample showing how the fix will affect your code.

Sometimes, more than one option exists for fixing a design-time error. For example, you might have the following code in your ASP.NET page:

Dim x As Integr

In this case, Integr is spelled incorrectly; the correct spelling, of course, is Integer. The IDE notifies you of this error and opens up the associated error dialog. You have three options for fixing the error (shown in Figure 2-9). To fix it, you simply scroll to the appropriate fix and click that link.

Figure 2-9

28