Professional Documents
Culture Documents
E-Learning Models
Hassanin M. Al-Barhamtoshy
hassanin@kau.edu.sa
Chapter 1: Starting an E-Commerce Site Chapter 2: Laying Out the Foundations Chapter 3: Creating the Product Catalog: Part I Chapter 4: Creating the Product Catalog: Part II Chapter 5: Searching the Catalog
DATA
E-Commerce Tutorial
e-commerce tutorial that covers taxation, shipping, and many of the issues youll face when designing your site at :
http://hotwired.lycos.com/webmonkey/e-business/ building/tutorials/tutorial3.html
Check this out before you start designing your own site.
A Simple Scenario
A Simple Scenario
Start Visual Studio.NET 2005 Choose File New. Select Web Site.
Exercise: Creating the BalloonShop Project Execute the project in debug mode by pressing F5. At this point, Visual Web Developer will complain (as shown in Figure) that it cant debug the project as long as debugging is not enabled in web.config. (actually, at this point, the web.config file doesnt even exist). Click OK to allow Visual Studio to enable debug mode for you. Feel free to look at the newly created web.config file to see what has been done for you.
At this moment your project contains three files: 1. Default.aspx is your Web Form. 2. Default.aspx.cs is the code-behind file of the Web Form. 3. web.config is the projects configuration file.
Youll implement this structure by creating the following: 1. A Master Page containing the general structure of all the web sites pages, as shown in the Figure. 2. A number of Web Forms that use the Master Page to implement the various locations of the web site, such as the main page, the department pages, the search results page, and so on 3. A number of Web User Controls to simplify reusing specific pieces of functionality (such as the departments list box, the categories list box, the search box, the header, and so on)
The following figure shows a few of the Web User Controls youll create while developing BalloonShop.
To keep your sites folder organized, youll create a separate folder for all the user controls. Having them in a centralized location is helpful, especially when the project grows and contains a lot of files.
3. Create the Header.ascx user control in the UserControls folder. Right-click UserControls in Solution Explorer and click Add New Item. In the form that appears, choose the Web User Control template and change the default name to Header.ascx. Leave the other options in place (as shown in Figure), and click Add.
<%@ Control Language="C#" AutoEventWireup="true" CodeFile="Header.ascx.cs" Inherits="Header" %> <p align="center"> <a href="Default.aspx"> <img src="Images/BalloonShopLogo.png" border="0"> </a> </p>
5. Open BalloonShop.master in Design View, drag Header.ascx from Solution Explorer, drop it near the Header text, and then delete the Header text from the cell.
Congratulations once again! Your web site has a perfectly working header!