1、- 1 - Configuring an Application One element seems to be missing from the Visual Basic .NET code shown in Listing 4-3. Alt-hough Ive often extolled the virtue of using Option Explicit, I didnt use it in this example,w- hich can bedone by settingExplicit=“true“ in Page. I can assure you that the page
2、 does require variables to be declaredI missed one of the references to loop when converting the application from C# to VisualBasic .NET and an error page did in fact appear。 This error message contains quite a bit more information thanASP error messages had, and it includes the section of code that
3、 produced the error, with the line in which the error occurred displayed in red. By default, this detailed error message will appear only on the machine on which the application is running. This is good default behavoir because its poss- ible that thesource code displayed could include informationab
4、out database user names and password, or worse. So if I didnt set Explicit to true, why did I get the error message about the understand v- ariable (badly reported in this example as “Expected an expression“)? The answer is the Web- .config file. In addition to specifying Explict and Strict oneach page, Web.config provides an application-global way to configure these and other application settings. Listing 4-5 shows a simple Web.config file. Listing 4-5 Simple Web.config file, with Expl