Tailspin Spyworks指南第一讲:创建项目

15 篇文章 0 订阅

Part 1: 文件-> 创建项目

By  Joe Stagner |July 21, 2010
Translated By litdwg |March 12,2014

Tailspin Spyworks demonstrates how extraordinarily simple it is to create powerful, scalable applications for the .NET platform. It shows off how to use the great new features in ASP.NET 4 to build an online store, including shopping, checkout, and administration.

通过Tailspin Spyworks 演示在.NET平台创建功能强大,结构良好的应用程序有多么简单。演示如何使用ASP.NET 4的新特性创建一个包含购物、结算和管理功能的在线网店。

This tutorial series details all of the steps taken to build the Tailspin Spyworks sample application.  Part 1 covers Overview and File/New Project.

本系列指南对构建案例程序的每一步做了详细的解释。第一部分包括综述和创建新项目。

 

概述

This tutorial is an introduction to ASP.NET WebForms. We'll be starting slowly, so beginner level web development experience is okay.

The application we'll be building is a simple on-line store.

指南介绍ASP.NET WebForms,不需要太多web开发经验也能明白。


Visitors can browse Products by Category:

顾客可通过类别浏览商品:


They can view a single product and add it to their cart:

可浏览具体商品病添加到购物车:


They can review their cart, removing any items they no longer want:

可查看购物车,移除不想要的商品:


Proceeding to Checkout will prompt them to
执行结束将会把顾客引入此界面:



After ordering, they see a simple confirmation screen:

订购之后,顾客看到确认界面:


We'll begin by creating a new ASP.NET WebForms project in Visual Studio 2010, and we'll incrementally add features to create a complete functioning application. Along the way, we'll cover database access, list and grid views, data update pages, data validation, using master pages for consistent page layout, AJAX, validation, user membership, and more.

首先创建VS 2010的项目,随后逐步添加功能完成一个完整的程序。此过程将包括数据库访问,list和gridview,数据更新页面,数据验证,使用master页面控制布局,AJAX,验证、用户管理等。

You can follow along step by step, or you can download the completed application fromhttp://tailspinspyworks.codeplex.com/

可跟随步骤完成,也可去http://tailspinspyworks.codeplex.com/下载完整的程序。

You can use either Visual Studio 2010 or the free Visual Web Developer 2010 fromhttp://www.microsoft.com/express/Web/. To build the application, you can use either SQL Server or the free SQL Server Express to host the database.

可使用VS2010或免费的VWD2010.数据库可使用SQL Server或免费的SQL Server Express

/ew Project

/ New Project

创建新项目

We'll start by selecting the New Project from the File menu in Visual Studio. This brings up the New Project dialog.

新建项目。


We’ll select the Visual C# / Web Templates group on the left, and then choose the “ASP.NET Web Application” template in the center column. Name your project TailspinSpyworks and press the OK button.

如下图选择、设置,然后点击OK按钮。


This will create our project. Let's take a look at the folders that are included in our application in the Solution Explorer on the right side.

创建项目之后的界面效果。


The Empty Solution isn't completely empty – it adds a basic folder structure:

解决方案管理器中列出的程序基本结构:


Note the conventions implemented by the ASP.NET 4 default project template.

注意默认文件夹的功能。

  • The "Account" folder implements a basic user interface for ASP.NET's membership subsystem.
  • The "Scripts" folder serves as the repository for client side JavaScript files and the core jQuery .js files are made available by default.
  • The "Styles" folder is used to organize our web site visuals (CSS Style Sheets)

When we press F5 to run our application and render the default.aspx page we see the following.

点击F5,运行效果如下:


Our first application enhancement will be to replace the Style.css file from the default WebForms template with the CSS classes and associated image files that will render the visual asthetics that we want for our Tailspin Spyworks application.

替换掉默认的Style.css文件,修改显示效果,将相应需要的图片添加到项目中。

After doing so our default.aspx page renders like this.

修改后,页面效果如下:


Notice the image links at the top right of the page and the menu items that have been added to the master page. Only the "Sign In" and "Account" links point to pages that exist (generated by the default template) and the rest of the pages we will implement as we build our application.

注意,右上方的图片链接和红色的菜单添加到了master页面中。其中只有“Sign In”和“Account”链接已经可用,别的随后会逐一实现。

We're also going to relocate the Master Page to the Styles directory. Though this is only a preference it may make things a little easier if we decide to make our application "skinable" in the future.

将Master页面重定位到Sytles文件夹。这样做以便于后期需要为程序实现“主题风格可变”时使用。

After doing this we'll need to change the master page references in all the .aspx files generated by the default ASP.NET WebForms pages.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值