comp3121 e-business technologies richard henson university of worcester november 2010

59
COMP3121 COMP3121 E-Business E-Business Technologies Technologies Richard Henson Richard Henson University of Worcester University of Worcester November November 2010 2010

Post on 21-Dec-2015

215 views

Category:

Documents


1 download

TRANSCRIPT

COMP3121COMP3121E-Business TechnologiesE-Business Technologies

Richard HensonRichard Henson

University of WorcesterUniversity of Worcester

NovemberNovember 20102010

Week 6: Server Scripting and Week 6: Server Scripting and Forms Design for Shopping CartsForms Design for Shopping Carts

Objectives:Objectives: Contrast between HTML & asp.net server code; code Contrast between HTML & asp.net server code; code

in file and code behind asp.net pagesin file and code behind asp.net pages Understand the structure of asp.net web controls that Understand the structure of asp.net web controls that

link to databaseslink to databases Use a rapid development environment to create a Use a rapid development environment to create a

server script that will extract/display data from a server script that will extract/display data from a specified database held on a specified web serverspecified database held on a specified web server

Use web applications appropriately to improve web Use web applications appropriately to improve web traffic to a websitetraffic to a website

Defining the Language to be Defining the Language to be Interpreted or CompiledInterpreted or Compiled

Language definition (essential start to script):Language definition (essential start to script):<%@ LANGUAGE=ScriptingLanguage %>where @ - is a processing directive to the web

server about how to process an .asp or .aspx file

the actual language name has to be correctly included e.g.:» <%@ LANGUAGE= JavaScript %>

» <%@ LANGUAGE= VBScript %>

» <%@ LANGUAGE= C# %>

Use of Comments within files

ALWAYS a good idea:makes the script easier to understand

Server-side scripts should be commentedNOT sent to the browser, so no excuse!

HTML comments are processed, however…

» slows things down & uses resources

Convention used depends on the language…

Use of Comments within files Apostrophe for VBScript

‘This is a VBScript comment

Two slashes for JScript//This is a JScript comment

Three slashes for C# /// <summary> /// The myClass class represents an

arbitrary class /// </summary>

For learning C# without using books, try:http://www.softsteel.co.uk/tutorials/cSharp/cont

ents.html

HTML and Web formsHTML and Web forms

HTML forms work at the client HTML forms work at the client end:end:collect data in a structured waycollect data in a structured waystore data as pre-defined type in store data as pre-defined type in

with specific field name on the local with specific field name on the local machinemachine

Web forms are asp.net constructsWeb forms are asp.net constructseasily created using .net toolbox in VWDeasily created using .net toolbox in VWD

Care with mapping of data Care with mapping of data within a HTML formwithin a HTML form

Essential to know how HTML forms workEssential to know how HTML forms work provides a useful aid to identifying errorsprovides a useful aid to identifying errors may need to create them from scratch, and may need to create them from scratch, and

drag/drop fields into the boxesdrag/drop fields into the boxes Fieldnames & data added to the form can Fieldnames & data added to the form can

be:be: sent direct to an email addresssent direct to an email address

» useful for sending orders for products by emailuseful for sending orders for products by email sent to a web server for storage in a simple sent to a web server for storage in a simple

datafile or relational databasedatafile or relational database» useful for e.g. automated storage of ordersuseful for e.g. automated storage of orders

HTML forms Input-Output syntax HTML forms Input-Output syntax

ACTIONACTION points the form to a URL that points the form to a URL that will accept the supplied information and will accept the supplied information and do something with itdo something with itit is up to the web server at that website to it is up to the web server at that website to

deduce the type of script from its suffixdeduce the type of script from its suffixthe web server then needs to use the web server then needs to use

appropriate software to process itappropriate software to process it

HTML forms Input-Output syntaxHTML forms Input-Output syntax

METHODMETHOD tells the form how to send its tells the form how to send its data fields back to the script:data fields back to the script:POST sends all the information from the POST sends all the information from the

form separately from the URL stringform separately from the URL string» could be used with mailtocould be used with mailto

GET attaches the information from the form GET attaches the information from the form to the end of the URL string (max 255 to the end of the URL string (max 255 characters)characters)

HTML form/server script application HTML form/server script application case study: “orderform”case study: “orderform”

The application was required to…The application was required to… receive structured data passed from the form receive structured data passed from the form send data to and from the lines of a text file in a send data to and from the lines of a text file in a

particular folder (WHICH NEEDED TO EXIST! particular folder (WHICH NEEDED TO EXIST! THINKING AHEAD ALWAYS A GOOD IDEA…)THINKING AHEAD ALWAYS A GOOD IDEA…)

add delimiters to separate the fields within a record add delimiters to separate the fields within a record and stored the record as a text fileand stored the record as a text file

extract and display the completed contents of the extract and display the completed contents of the filefile

All had to be achieved through VBScript codeAll had to be achieved through VBScript code

““extra code” filesextra code” files

Several ways of including extra code via a further text filecalled within that particular page useful for portability of code can also reduce site maintenance time and

increase code reuse allows a modular development approach

Server-Side #Include (SSI) Directive

.inc file can be used with multiple asp(x) pages syntax:

» place the #INCLUDE directive and either “VIRTUAL” or “FILE” keyword inside what would normally be HTML comment tags, and then =“filename”

» e.g: <!--#include file="common/copyright.inc"-->

Using “Code Behind”

From asp.net v2 onwards, Microsoft From asp.net v2 onwards, Microsoft encouraged the use of separate code pages encouraged the use of separate code pages and HTML pages for server side developmentand HTML pages for server side development code page saved with a different filenamecode page saved with a different filename

Advantage:Advantage: Web page designer works on the HTML-based Web page designer works on the HTML-based

pagepage .net developer works on the “code behind.net developer works on the “code behind

““Classes” and The Code Classes” and The Code Behind modelBehind model

As previously described, but worth As previously described, but worth repeating… repeating… when an ASP.NET page is requested and renders when an ASP.NET page is requested and renders

markup to a browsermarkup to a browser at run time, ASP.NET generates and compiles one at run time, ASP.NET generates and compiles one

or more classes that actually perform the tasks or more classes that actually perform the tasks required to run the pagerequired to run the page

This means that the code that runs is not This means that the code that runs is not solely the code that you created for the pagesolely the code that you created for the page

““Classes” Classes” and The and The

Code Code Behind Behind modelmodel

Generating and Running the Generating and Running the Page Class CodePage Class Code

An ASP.NET page runs as a unit, combining:An ASP.NET page runs as a unit, combining: the server-side elements in a page, such as the server-side elements in a page, such as

controlscontrols with the event-handling code you have written (or with the event-handling code you have written (or

had written for you…)had written for you…)

The class or classes that the compiler creates The class or classes that the compiler creates depends on whether the page uses the depends on whether the page uses the single-file model or the code-behind modelsingle-file model or the code-behind model no need to pre-compile pages into assemblies!no need to pre-compile pages into assemblies!

Generating and Running the Generating and Running the Page Class CodePage Class Code

ASP.NET dynamically compiles & runs pages ASP.NET dynamically compiles & runs pages the first time they are requested by a userthe first time they are requested by a user IF…any changes are subsequently madeIF…any changes are subsequently made

» either to the page either to the page » or resources the page depends onor resources the page depends on

THEN… the page is automatically recompiledTHEN… the page is automatically recompiled ASP.NET also supports precompilation of a ASP.NET also supports precompilation of a

Web site (both single-file and code-behind Web site (both single-file and code-behind page models):page models): to enhance performanceto enhance performance to perform error checkingto perform error checking to support site deploymentto support site deployment

Single-File PagesSingle-File Pages

The HTML, server-side elements, and The HTML, server-side elements, and event-handling code are all kept in a event-handling code are all kept in a single .aspx filesingle .aspx filewhen the page is compiled:when the page is compiled:

» EITHER the compiler either generates and EITHER the compiler either generates and compiles a new class that derives from the base compiles a new class that derives from the base Page class Page class

» OR a custom base class defined with the OR a custom base class defined with the InheritsInherits attribute of the attribute of the @ Page@ Page directive. directive.

Single-File PagesSingle-File Pages

Example:Example:» if a new ASP.NET Web if a new ASP.NET Web

page named SamplePage1 page named SamplePage1 is created in application is created in application root directoryroot directory

» then a new class named then a new class named ASP.SamplePage1_aspx ASP.SamplePage1_aspx is derived from the is derived from the PagePage classclass

Single-File PagesSingle-File Pages IF inside an application subfolder, subfolder IF inside an application subfolder, subfolder

name is used as part of the generated class name is used as part of the generated class » contains declarations for the controls in the .aspx pagecontains declarations for the controls in the .aspx page» contains the event handlers and other custom codecontains the event handlers and other custom code

After page generation…After page generation…» generated class is compiled into an assemblygenerated class is compiled into an assembly» assembly loaded into the application domainassembly loaded into the application domain» page class instantiated & executed to render output to the page class instantiated & executed to render output to the

browserbrowser

IF page changes & would affect the generated IF page changes & would affect the generated class (e.g. adding controls/modifying code)class (e.g. adding controls/modifying code)

THENTHEN» compiled class code is invalidatedcompiled class code is invalidated» a a new classnew class is generated is generated

Including other files with aspx Other suffixes can also be used for

different types of static code:e.g. .css files (same principle, slightly

different syntax)e.g. constants and variables files for a

particular script type:» e.g. mmhttpdb.js (supports java objects used by

Dreamweaver for database connections to aspx files)

Global.asax (.net equivalent of global.asa)

An An optional optional way of including otherwise unlisted way of including otherwise unlisted events, objects, with application aspx scriptsevents, objects, with application aspx scripts normally placed in root foldernormally placed in root folder

More secure than & works in a different way to More secure than & works in a different way to global.asa:global.asa: .NET configured so that any direct URL request .NET configured so that any direct URL request

for Global.asax automatically rejectedfor Global.asax automatically rejected» external users therefore cannot download or view external users therefore cannot download or view

the code in itthe code in it

Parsed at run time & compiledParsed at run time & compiled» dynamically generated .NET class (HttpApplication)dynamically generated .NET class (HttpApplication)

Use of Multiple Scripting languages

HTML <SCRIPT> tag and its LANGUAGE added within the .asp or .aspx codeRUNAT attributes (where code is executed)

optionally added

Syntax: <SCRIPT LANGUAGE=ScriptingLanguage RUNAT=Server>

script… </SCRIPT>

Similar syntax used for embedded client code

Keeping it simple! Multiple languages not recommended on a

single page!!!but the syntax allows this…

Not even recommended for different pages in the same application…makes the ASP.net engine load multiple scripting

engineshas to then perform more work to determine which

piece of script should be sent to which scripting engine!

reduces the responsiveness and scalability of the application

Use of Comments in aspx files Apostrophe for VBScript

‘This is a VBScript comment

Two slashes for JScript//This is a JScript comment

Three slashes for C# /// <summary> /// The myClass class represents an

arbitrary class /// </summary>

If you wish to learn C#, try:http://www.softsteel.co.uk/tutorials/cSharp/cont

ents.html

““Components” and “Objects”Components” and “Objects” Very similar and easily confused…Very similar and easily confused…

object: part of the library of files available to the object: part of the library of files available to the whole applicationwhole application

component: a number of objectscomponent: a number of objects» a mini-application in its own righta mini-application in its own right

» any instance of a component must be explicitly created before it any instance of a component must be explicitly created before it can be usedcan be used

Microsoft provide a library of COM componentsMicrosoft provide a library of COM components IIS ASP environment was mostly COM components!IIS ASP environment was mostly COM components!

Dreamweaver’s Extension Manager made it Dreamweaver’s Extension Manager made it very easy to add COM components to the very easy to add COM components to the Dreamweaver environment…Dreamweaver environment…

Advantages of Components A component encapsulates a set of business

functionality can be either compiled or scripted

e.g. a query component might retrieve a customer's order history from a database based on the parameter “user account”

ASP components allowed developers to provide the same sophisticated business logic in Web sites that was available in applicationsmany third party COM components were developed

Using COM in aspx files BIG disadvantage of COM (later COM+) components…

VB source code so slow & easy to hackcouldn’t be directly used with .net (even VB.net used a slightly

different syntax!) BUT… popular with developers…

provided consistent, reusable functionalityeasy to maintain and sharecould be modified or enhanced without affecting the rest of

the application Microsoft therefore reluctant to give up a good thing and

encouraged using COM+ with .nethttp://msdn2.microsoft.com/en-us/library/bb735856.aspx

ObjectsObjects A series of chunks of server script code that A series of chunks of server script code that

will together provide web functionalitywill together provide web functionality available in a number of languagesavailable in a number of languages

» asp, asp.netasp, asp.net» php, cold fusionphp, cold fusion

Using RAD tools, added to a dynamic HTML page Using RAD tools, added to a dynamic HTML page “at the click of a mouse button”“at the click of a mouse button”

Several objects usually used together to Several objects usually used together to create a useful web application e.g. create a useful web application e.g. data capture form and sending data to databasedata capture form and sending data to database presentation of data from a databasepresentation of data from a database

Potential Problems of Scripting in Potential Problems of Scripting in the RAD Environment…the RAD Environment…

A lot can go wrong during development…A lot can go wrong during development… Scripting language needs to be defined at the Scripting language needs to be defined at the

start of the pagestart of the page dynamic “new” pages provide a range of optionsdynamic “new” pages provide a range of options

Application objects can:Application objects can: be inserted in the wrong place…be inserted in the wrong place… themselves become muddledthemselves become muddled

» partly written in HTMLpartly written in HTML

Potential Problems of Scripting in Potential Problems of Scripting in the RAD Environment… the RAD Environment…

(continued)(continued)

Embedded server script code can be Embedded server script code can be dependent on a link to a databasedependent on a link to a database that link needs to be functioning correctlythat link needs to be functioning correctly database field types must correspond with script database field types must correspond with script

equivalentsequivalents if the database changes significantly, the script if the database changes significantly, the script

must accommodate the field, etc. changes…must accommodate the field, etc. changes…» roll out carefullyroll out carefully

» may be easier to recreate the object, or even the whole page(s)may be easier to recreate the object, or even the whole page(s)

VBScript objects VBScript objects (ADOs) and IIS asp environment(ADOs) and IIS asp environment Code has to be managed and executed to Code has to be managed and executed to

become machine code for the CPUbecome machine code for the CPU With server scripts, achieved through web With server scripts, achieved through web

serverserver IIS web server environment has five IIS web server environment has five

particularly useful VBScript objects that can particularly useful VBScript objects that can be evoked in asp scripts for interaction with be evoked in asp scripts for interaction with data :data : Session, Application, Request, Server, ResponseSession, Application, Request, Server, Response

ASP VBScript Objects in ASP.netASP VBScript Objects in ASP.net SessionSession

maintains user information across multiple web maintains user information across multiple web page requestspage requests

information kept for the duration of a user's sessioninformation kept for the duration of a user's session a good place to store data specific to the usera good place to store data specific to the user

Sessions in ASP.NET use a Session ID (32-bit Sessions in ASP.NET use a Session ID (32-bit long integer)long integer) generated by ASP.net engine for uniquenessgenerated by ASP.net engine for uniqueness

other variables easily added:other variables easily added: Session(“username”) = “Joseph Bloggs”Session(“username”) = “Joseph Bloggs” Session(“color”) = “Blue”Session(“color”) = “Blue”

all stored in memory as hash tables including “timeout” valueall stored in memory as hash tables including “timeout” value

Session(“variable”) can then be used to call up dataSession(“variable”) can then be used to call up data

ASP VBScript Objects in ASP.netASP VBScript Objects in ASP.net ApplicationApplication

used to share information among all users of the used to share information among all users of the Web applicationWeb application

a good place to store anything common to the a good place to store anything common to the application such as:application such as:

» database connection stringsdatabase connection strings

» frequently used lookup listsfrequently used lookup lists

» environment informationenvironment information

ASP.net Applications have an Application ID ASP.net Applications have an Application ID 32-bit long integer 32-bit long integer generated as for session obj generated as for session obj Application variables generated in a similar way to Application variables generated in a similar way to

asp.net session variables…asp.net session variables…

ASP VBScript Objects in ASP.netASP VBScript Objects in ASP.net Request Request – the– the only way asp could retrieve the only way asp could retrieve the

input data entered by the user in the input fields in input data entered by the user in the input fields in the pagethe page used to access information passed from the browser used to access information passed from the browser

when requesting a Web pagewhen requesting a Web page handles HTML form fields, client certificate information, handles HTML form fields, client certificate information,

and cookiesand cookies

In ASP.NET, HttpRequest class fulfils this functionIn ASP.NET, HttpRequest class fulfils this function anan instance (object) called instance (object) called RequestRequest created by default created by default

in all the pagesin all the pages provides various methods and properties for using the various provides various methods and properties for using the various

information related to a web requestinformation related to a web request

however.. ASP.NET also provides an event handling however.. ASP.NET also provides an event handling mechanism & web controls to access user inputsmechanism & web controls to access user inputs

ASP VBScript Objects in ASP.netASP VBScript Objects in ASP.net

Response – exact opposite of requestResponse – exact opposite of request sends information back to the browsersends information back to the browser includes dynamic Web pages and cookies includes dynamic Web pages and cookies

as well as instructions that redirect the as well as instructions that redirect the browser to another URLbrowser to another URL

In asp.net, the equivalent is the class In asp.net, the equivalent is the class HttpResponseHttpResponse as with “Request” there is an easier way in as with “Request” there is an easier way in

asp.net using event handling and web asp.net using event handling and web controlscontrols

ASP VBScript Objects in ASP.netASP VBScript Objects in ASP.net ServerServer

mainly used with CreateObject to instantiate mainly used with CreateObject to instantiate objects in asp scriptsobjects in asp scripts

Much more sophisticated treatment in Much more sophisticated treatment in asp.net:asp.net: here’s where the “web controls” come in usefulhere’s where the “web controls” come in useful

Syntax for creation: <asp:control_name …...code…. />Syntax for creation: <asp:control_name …...code…. />

can be invoked with the aid of “runat=“server”can be invoked with the aid of “runat=“server”

long list of these in Dreamweaver MX Insert/asp.net objectslong list of these in Dreamweaver MX Insert/asp.net objects

Extracting data Extracting data from a Databasefrom a Database

Database tables and fields need to be Database tables and fields need to be carefully mapped tocarefully mapped to HTML FormsHTML Forms Web FormsWeb Forms

Essential to use MDACEssential to use MDAC Databases changeDatabases change Scripting changesScripting changes latest MDAC version always recommended!latest MDAC version always recommended!

Normally used in association with tables to Normally used in association with tables to present the data appropriately on the screenpresent the data appropriately on the screen

Compiled code for interfacing with Compiled code for interfacing with Access (and other) databasesAccess (and other) databases

All started with All started with ActiveX Data Objects (ADO)ActiveX Data Objects (ADO) script connectivity for Microsoft Accessscript connectivity for Microsoft Access

Gave rise to the MDAC Microsoft technology that provided Gave rise to the MDAC Microsoft technology that provided connectivity to any ODBC or OLE DB data sourceconnectivity to any ODBC or OLE DB data source

Remember… ActiveX = compiled code; source can be written Remember… ActiveX = compiled code; source can be written in a variety of languagesin a variety of languages

ADO allows integration of E-Commerce ADO allows integration of E-Commerce applications with legacy accounting and applications with legacy accounting and fulfilment systemsfulfilment systems

» any changes in an inventory or pricing database will be any changes in an inventory or pricing database will be reflected in the Web application immediatelyreflected in the Web application immediately

» no need to change any code!no need to change any code!

Scripting and Database Scripting and Database ConnectivityConnectivity

Focus design on accessing the database as Focus design on accessing the database as little as possible e.g.little as possible e.g. issue one query to retrieve common data such as issue one query to retrieve common data such as

list box entrieslist box entries store the results in Application object variablesstore the results in Application object variables

preferable to repeatedly issuing the same preferable to repeatedly issuing the same database query... database query...

Consider de-normalizing the databaseConsider de-normalizing the database performance of Web applications can be improved performance of Web applications can be improved

by reducing the number of joins in SQL statementsby reducing the number of joins in SQL statements

Selection of Selection of Server Behaviours (.net Controls)Server Behaviours (.net Controls)

First things first:First things first:select an appropriate language for the select an appropriate language for the

dynamic page as it is created…dynamic page as it is created…» VB, VB.net, php, cf, C#VB, VB.net, php, cf, C#

Then make the toolbox visible…Then make the toolbox visible…A number of server behaviours are provided A number of server behaviours are provided

to assist with database accessto assist with database access

Standard .net Standard .net Server Behaviours Server Behaviours

DatasetsDatasetslocal fields taken from remote tableslocal fields taken from remote tables

Insert/Update/Delete recordInsert/Update/Delete record CommandCommand

esp. useful for embedding SQL statementsesp. useful for embedding SQL statements

Repeat RegionRepeat Regiondisplay a series of records on a single formdisplay a series of records on a single form

More Standard .net More Standard .net Server Behaviours Server Behaviours

DataGrid & DataListDataGrid & DataList DataSetDataSet

show/navigate regionshow/navigate regionshow/navigate pagingshow/navigate paging

Dynamic textDynamic textlist/menu/textfield/checkbox/radio list/menu/textfield/checkbox/radio

buttons…buttons…

Using Server Behaviours Using Server Behaviours written in asp.netwritten in asp.net

The RAD environment can write the code…The RAD environment can write the code… However, before running through a real web However, before running through a real web

server, the developer must make sure the server, the developer must make sure the structure of the site is right:structure of the site is right: remote site must map to localhost as defined within remote site must map to localhost as defined within

IISIIS remote folder must contain a \bin or \App_Data remote folder must contain a \bin or \App_Data

folder which must contain the assembly(ies) that will folder which must contain the assembly(ies) that will convert the .aspx code into executable code:convert the .aspx code into executable code:

remote site must contain a remote site must contain a web.configweb.config file that file that maps to the database in the “remote” foldermaps to the database in the “remote” folder

Using Server Scripting to Using Server Scripting to Create a Shopping SystemCreate a Shopping System

Product Information stored on databaseProduct Information stored on database Script connects to databaseScript connects to database Products can all be displayed on a pageProducts can all be displayed on a page If products are divided into categories…If products are divided into categories…

A different page can be used to store products of A different page can be used to store products of different categorydifferent category

But how can users “click to buy”?But how can users “click to buy”? this is where the shopping cart comes in very this is where the shopping cart comes in very

handy…handy…

A Shopping System front end A Shopping System front end (Home Page & Product Pages)(Home Page & Product Pages)

Entirely web-driven:Entirely web-driven:essential to have a home page (shop essential to have a home page (shop

window)window)» attractive (marketing!)attractive (marketing!)» should link to product categoriesshould link to product categories» category pages link to product pagescategory pages link to product pages

Product pages should include:Product pages should include:» image/description of productimage/description of product

» priceprice

» an option to buy... an option to buy...

Shopping System Back EndShopping System Back End(server-based systems only)(server-based systems only) Database with tables for product, Database with tables for product,

transaction, and possibly customer transaction, and possibly customer datadatausually held on a remote web serverusually held on a remote web server

Scripts to manipulate dataScripts to manipulate data Connectivity string(s) to enable scripts Connectivity string(s) to enable scripts

to interact with databaseto interact with database SQL statements to query the table(s)SQL statements to query the table(s)

““Click to buy” ScriptingClick to buy” Scripting

Better known as the Better known as the shopping cartshopping cart back end provides scripts, etc. to cover all back end provides scripts, etc. to cover all

aspects of a transaction including data storageaspects of a transaction including data storage front end interfaces with product pages and uses front end interfaces with product pages and uses

product selection to pass information to the cartproduct selection to pass information to the cart cart itself provides details of the transaction:cart itself provides details of the transaction:

» Cart data used to create an on-line order and on-line invoice, Cart data used to create an on-line order and on-line invoice, and send an order to an email addressand send an order to an email address

The system is also used to manage on-line The system is also used to manage on-line payment via secure link to an on-line payment via secure link to an on-line banking servicebanking service

What makes a successful What makes a successful on-line B2C E-commerce site?on-line B2C E-commerce site? One thatOne that attracts customers attracts customers

And retains customers…And retains customers… Principles of good design well establishedPrinciples of good design well established

web pages appropriately designedweb pages appropriately designed shopping system user-friendly & works efficientlyshopping system user-friendly & works efficiently

Successful e-commerce websites save the Successful e-commerce websites save the vendor an awful lot of money!vendor an awful lot of money! problem: high initial costproblem: high initial cost gain: potentially huge ROIgain: potentially huge ROI

What makes a successful What makes a successful on-line B2C E-commerce site?on-line B2C E-commerce site? A site will retain customers if it works A site will retain customers if it works

well… at fulfilment and after-sales well… at fulfilment and after-sales serviceservicekeeps customer informedkeeps customer informedkeeps customer & order data securekeeps customer & order data securedoesn’t lose customer datadoesn’t lose customer data

» or sell it to e-marketing companies…or sell it to e-marketing companies…Keeps in regular contact with customer via Keeps in regular contact with customer via

emailemail

B2C E-commerce: Keeping B2C E-commerce: Keeping the customer satisfied…the customer satisfied…

All transaction data has to be presented All transaction data has to be presented digitally on-screen… digitally on-screen… order forms (no opening envelopes and processing order forms (no opening envelopes and processing

an order from paper)an order from paper) invoices (no need to print them, put them into invoices (no need to print them, put them into

envelopes, or send them off by post)envelopes, or send them off by post) Huge potential cost saving, but the screen Huge potential cost saving, but the screen

interface must be designed FOR THE interface must be designed FOR THE CUSTOMER!!!CUSTOMER!!!

If the customer is not comfortable with it, they If the customer is not comfortable with it, they may not buy… and may not returnmay not buy… and may not return

Importance of Consistent Importance of Consistent Page DesignPage Design

Not talking about artistic merit, etc…Not talking about artistic merit, etc… Psychology experiments show that Psychology experiments show that

people prefer a consistent layout people prefer a consistent layout between pagesbetween pages

Also essential in on-line shopping sitesAlso essential in on-line shopping sites Achieved by using:Achieved by using:

HTML Page Templates & Cascading style HTML Page Templates & Cascading style sheetssheets

Asp.net Master Pages & page “themes”..Asp.net Master Pages & page “themes”..

Justifying the Cost of a Justifying the Cost of a Shopping Cart SystemShopping Cart System

Many ways to create a shopping cart Many ways to create a shopping cart system:system: how does the business know what is good how does the business know what is good

value for money?value for money? Internet or cloud-based systems may look Internet or cloud-based systems may look

attractive…attractive…» may appear to be cheapermay appear to be cheaper

» may appear to manage everything for the businessmay appear to manage everything for the business

» how well does outsourcing fit withhow well does outsourcing fit with business objectivesbusiness objectives regulatory requirementsregulatory requirements

Business Benefits of B2CBusiness Benefits of B2C

Can generate more sales…Can generate more sales… increase revenueincrease revenue

BUT how can B2C e-commerce cut costs?BUT how can B2C e-commerce cut costs? data input is done by the customerdata input is done by the customer

» help from the shopping pages and shopping carthelp from the shopping pages and shopping cart

data output is presented directly on the screendata output is presented directly on the screen cuts greatly on administration…cuts greatly on administration…

Internet MarketingInternet Marketing Huge growth area…Huge growth area…

Whole conferences devoted to e.g. “Technologies Whole conferences devoted to e.g. “Technologies for Marketing”for Marketing”

In the early days of e-commerce, the rate of In the early days of e-commerce, the rate of hits on website WAS the value of the hits on website WAS the value of the company (!)company (!) now revised downwards, but same principle now revised downwards, but same principle

applies…applies…» formula based on (say) every tenth visitor will be a formula based on (say) every tenth visitor will be a

customer…customer…

Best ways to attract visitors:Best ways to attract visitors: use search engines effectivelyuse search engines effectively advertise URL effectively using a diverse range of advertise URL effectively using a diverse range of

mediamedia

Promoting the well-designed Promoting the well-designed WebsiteWebsite

The business will not get any benefits The business will not get any benefits from increase in sales if there are no from increase in sales if there are no visitorsvisitorshowever excellent the site may be…however excellent the site may be…

MANY ways to maximise the number of MANY ways to maximise the number of visitors to a site…visitors to a site…

Suggestions? Group Activity…Suggestions? Group Activity…

Technologies for Technologies for Improving Hit RateImproving Hit Rate

Many applications availableMany applications available Some very simpleSome very simple

» counterscounters» meta name generatorsmeta name generators» date/time/special effects, etc. (client end)date/time/special effects, etc. (client end)» links to code located on other sides (e.g weather forecast)links to code located on other sides (e.g weather forecast)

Others more sophisticated: two categories:Others more sophisticated: two categories:» watch/record visitor behaviourwatch/record visitor behaviour

Example: ASP SheriffExample: ASP Sheriff

» provide more features for the siteprovide more features for the site Any number of possibilitiesAny number of possibilities

Effective Use of Search Engines Effective Use of Search Engines Objective: to use appropriate Objective: to use appropriate

techniques to cause the search engine techniques to cause the search engine display your site in its “top ten”display your site in its “top ten”Search Engine “spiders”Search Engine “spiders”

» crawl round the net looking out for keywords in web crawl round the net looking out for keywords in web pagespages

» retrieve keywords and corresponding URLsretrieve keywords and corresponding URLs

» take keywords back to the search engine database take keywords back to the search engine database

» Program automatically adds the lists of keywords to Program automatically adds the lists of keywords to the databasethe database

right keywords MUST be presented to the spidersright keywords MUST be presented to the spiders

Effective Use of Effective Use of Search Engines (2)Search Engines (2)

Objective: keeping the site in the top tenObjective: keeping the site in the top ten Search engines like Google monitor websites:Search engines like Google monitor websites: Longer-term ranking also based on:Longer-term ranking also based on:

hit ratehit rate number, and activity, of external links on sitenumber, and activity, of external links on site

Technologies available to help boost rankingsTechnologies available to help boost rankings Whole new discipline of e-marketing…Whole new discipline of e-marketing…