= GetTopSellingAlbums (5 );
Return View (albums );
}
The complete code is as follows:
Using System;
Using System. Collections. Generic;
Using System. Linq;
Using System. Web;
Using System. Web. Mvc;
Using MvcMusicStore. Models;
Namespace MvcMusicStore. Controllers
{
Public class HomeController: Controller
{
Private Models. MusicStoreEntities storeDB = new Models. MusicStoreEntities ();
//
// GET:/Home/
Public ActionResult Index ()
{
// Get most popular albums
Var albums = GetTopSellingAlbum
mvc music store @ Renderbody ()
Source code , All images, style scripts, and databases are in the mvcmusicstore-Assets Directory) to run the application. The new homepage is as follows:
Let's take a look at the changes:
Because the view template follows the standard naming conventions, the index Action Method of homecontroller finds and displays the \ views \ home \ index. aspx view template by c
Share a simple application instance of ASP. net mvc music store developed by myself. For more information, see. Select "new" from the File menu in Visual Studio and select "project. Then, select the Web template group in C #, select ASP. NET MVC3 Web application in the Project template on the right, enter MvcMusicStore in the project name input box, and click OK. At this time, you will go to the second dial
folders also exist in an empty ASP. net mvc application, because the ASP. net mvc framework uses"Conventions are better than configurations"It has been assumed that these folders have a specific purpose. For example, the Controller will find the corresponding view in the Views folder, without explicitly setting it in the code, which can save a lot of programming work, it also makes it easier for other developers to understand your program. During the process of creating this program, we will de
The MVC Music Store tutorial introduces and explains how to use ASP step by step. net mvc and Visual Web Developer conduct Web development. The tutorial starts from the most basic stage, so it is also applicable to developers in the initial stage.
We will create a simple music store, which consists of three parts: sho
Musicstore
MVC music store is based on the best ASP. netmvc getting started tutorial that guides you how to use MVC and Visual Studio for web development. The latest version of MVC music store is developed based on ASP. net mvc 3 using Visual Studio 2010.
Mvcquick. Framework
Mvcquick. An original open-source framework
, it can only be modified based on the original translation. Please check the original article ...... If there is a difference, basically the originalCodeI used MVC 2 to rewrite ......
Again Note: From here can download MVC 3 installation package: http://www.microsoft.com/downloads/en/details.aspx? Displaylang = en familyid = d2928bc1-f48c-4e95-a064-2a455a22c8f6, after installation, if you like the Chinese interface, in the following language options to change to simplified Chinese, download
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.