2010년 9월 10일 금요일

Mvc Music Store(2) - Create Project

File / New Project

Run Visual Studio. (In my case, I have Visual Studio 2008). Please select File>New>Project on then mainmenu.

Then we will select "ASP.NET MVC2 Empty Web Application" template. Please give the 
Name: MvcMusicStore
Location: C:\Project
Solution Name: MvcMusicStore


Press Add button and then after a while a new proejct will be created. Please have a look at the folders which are included in our application in the Solution Explorer on the right side.

ASP.NET MVC makes use of some basic conventions for folder names. I think that this is important knowledge to understand ASP.NET MVC.

 /Controllers
   Controllers are a kind of gateway because every request from Web Browser pass through Controllers. They respond to input from the browser, decide what to do with it, and return to the user. I can feel that this controllers act like a post office. Post office deliver their letters according to their address through post men. Therefore, our starting point in this project will be from Controllers.
/Views
  Views take charge of displaying content on the Web Browser. So Views include HTML and CSS codes. Views hold our UI templates.
/Content
  This folder holds some resources like images, CSS files, and any other static content.
/Scripts
  What is the scripts in Web Applications? It means JavaScript, so this folder contains JavaScript files.
/App_Data
  This folder holds data files which can be read and updated by the application.

Let's open Window Explorer and have a look at the real folder structure.

"MvcMusicStore" folder on the left has created under the Solution folder "MvcMusicStore" because we gave the same names with solution name and project name.


One interesting thing is ASP.NET MVC is using jQuery as a basic JavaScript framework. This indicates that ASP.NET MVC will offers all powerful functions jQuery does.

These folders are included even in an Empty ASP.NET MVC application because the framework makes some assumptions based on folder in naming conventions. For instance, controllers look for views in the Views folder by default, so sticking with the basic conventions not only makes it easier for other developers to understand your project, it simplifies your code.

2010년 9월 9일 목요일

Mvc Music Store(1) - Overview

Mvc Music Store is an good example which is provided by Microsoft ASP.NET web site. It guides us the concept of Model-View-Controler(MVC) in ASP.NET and .NET framework in Web development. I think that it is a good help to those who start with ASP.NET like me. I would like to share extensible information about this sample project. You can see the orginal lecture of this project on the site:



Overview
 
 Mvc Music store is a simple application based on ASP.NET MVC 2. There are three main parts in the application: shopping, checkout, and aministration. The feature of main page is like following.


In this application, the system has the requirements like:
 - Browsing albums by Genre.
 - Viewing the detail of an album.
 - Adding it to their shopping cart.
 - Reviewing cart, removing items in the cart. 
 - Checkout.
 - To login or register for a user account for Checkout.
 - Input order detail.(shipping information - name, address, tel no, etc...)
 - Administrator mode.(list, create, edit, and delete)

If you don't have Visual Studio or SQL Server, please download them first. The Express tools can be installed using the Web Platform installer here: http://www.microsoft.com/web/platform/tools.aspx
 


2010년 9월 7일 화요일

Troubleshooting - User instance error in SQL Server 2005 Express

Generating user interfaces in SQL Server is disabled. Use sp_configure 'user instances enabled' to generate user instance.

1. Download SQL Server Management Studio Express. You can download this software for free from Microsoft website.
2. Press Ctrl+N or Click File->New->Query with Current Connection and input query and execute:

    exec sp_configure

2010년 9월 4일 토요일

Configuration - Download SQL Server 2005 Express Edition

In order to install database, you can download SQL Server 2005 Edition version from the link below: 

http://www.microsoft.com/sqlserver/2005/en/us/express.aspx

Visit above site and click;

SQL Server 2005 Express Edition with Advanced Services SP3

Then, you will be able to download SQLEXPR_ADV_KOR.EXE.

After completion of installation, you will see some serivices through Windows Control Panel.