Microsoft 9GD00001 Computer Accessories User Manual


 
Chapter 9: Creating Web Applications with ASP.NET MVC 253
The Scripts folder holds JavaScript files, which include the jQuery and ASP.NET
AJAX client libraries. JavaScript helps make Views more interactive and can be
effective in providing a pleasing user experience.
The Global.asax file holds code that runs at different periods during the application
life cycle; we’ll investigate this file when looking at routing later in this chapter.
The web.config file holds configuration information, such as database connection
strings and more items that you don’t want to hard-code into the application.
NOTE
If you want to ship a local database with your application, you can right-click the App_
Data folder for your project, select Add | New Item, navigate to Data, and select SQL
Server Database. This will add a blank database *.mdf file under the App_Data folder.
You can work with this database through Server Explorer, using techniques learned in
Chapter 7, to add tables and other objects. Remember that the server you deploy to
must have SQL Server Express installed or your database operations won’t work.
The code generated by the New Project Wizard will run, and pressing F5 to execute the
application will show you a screen similar to Figure 9-3. Click OK when you see a screen
that asks if you want to program to run in debug mode. This will modify the web.config
file to allow debugging, which is what you want while developing applications.
Figure 9-3 Running the default code produced by an ASP.NET MVC project