DITEC - E-Commerce & ASP.NET

36
Diploma in Information Technology Module X: E-Commerce & ASP.NET Rasan Samarasinghe ESOFT Computer Studies (pvt) Ltd. No 68/1, Main Street, Pallegama, Embilipitiya.

Transcript of DITEC - E-Commerce & ASP.NET

Page 1: DITEC - E-Commerce & ASP.NET

Diploma in Information Technology

Module X: E-Commerce & ASP.NET

Rasan SamarasingheESOFT Computer Studies (pvt) Ltd.No 68/1, Main Street, Pallegama, Embilipitiya.

Page 2: DITEC - E-Commerce & ASP.NET

Contents

1. What is a Business ?2. E-Business3. Application of E-Businesses4. What is E-Commerce ?5. E-Commerce Models6. Business to Business (B2B)7. Business to Consumer (B2C)8. Consumer to Business (C2B)9. Business to Employee (B2E)10. Consumer to Consumer (C2C)11. Shopping Carts12. Types of Web Pages13. Creating Dynamic Web Pages14. What is ASP.NET ?

15. What you can do with ASP.NET ?16. How ASP.NET Works ?17. Features of ASP.NET18. ASP.NET Web Forms19. Controls in Web Forms20. HTML Controls21. Server Controls22. HTML Server Controls23. Event Handlers24. The Page Load Event25. IsPostBack Property26. Navigation by using Response Class27. Passing Values from Page to Another28. Data Binding to a Drop Down List

Page 3: DITEC - E-Commerce & ASP.NET

What is a Business ?

An organization that provides products or services to customers who want or need them.

Page 4: DITEC - E-Commerce & ASP.NET

E-Business

Electronic business is application of information and communication technologies

to improve your business processes.

Page 5: DITEC - E-Commerce & ASP.NET

Application of E-BusinessesCustomer Relationship

Management (CRM)Enterprise Resource

Planning (ERP)Document Management

System (DMS)Human Resources

Management (HRM)

Internet shopSupply chain management

Online marketingOnline Transactions

VoIPContent

Management SystemE-mail

VoicemailWeb ConferencingDigital work flows

Internal business systems

Electronic Commerce

Enterprise communication and collaboration

Page 6: DITEC - E-Commerce & ASP.NET

What is E-Commerce ?

Electronic Commerce is the buying and selling products or services over electronic systems

such as the internet and other computer networks.

Page 7: DITEC - E-Commerce & ASP.NET

E-Commerce Models

• Business to Business (B2B)• Business to Consumer (B2C)• Consumer to Business (C2B)• Business to Employee (B2E)• Consumer to Consumer (C2C)

Page 8: DITEC - E-Commerce & ASP.NET

Business to Business (B2B)

Transacting between businesses, such as between a manufacturer and a wholesaler, or

between a wholesaler and a retailer.

Page 9: DITEC - E-Commerce & ASP.NET

Business to Consumer (B2C)

This is refers to when businesses selling their products or services to the customer.

Page 10: DITEC - E-Commerce & ASP.NET

Consumer to Business (C2B)

In C2B consumers can offer products and services to companies and the companies pay

them.

Page 11: DITEC - E-Commerce & ASP.NET

Business to Employee (B2E)

Application of an intra business network which allows companies to provide products or

services to their employees.

Page 12: DITEC - E-Commerce & ASP.NET

Consumer to Consumer (C2C)

Involves the transactions between consumers through some third party.

Page 13: DITEC - E-Commerce & ASP.NET

Shopping Carts

• A shopping cart is a piece of web application software.

• It acts as an online store's catalog and ordering process.

• It allowing consumers to select goods, review what they have selected, and purchase them.

Page 14: DITEC - E-Commerce & ASP.NET

Types of Web Pages

• Static Web Pages• Dynamic Web Pages

Page 15: DITEC - E-Commerce & ASP.NET

Types of Web Pages

Static web pages contain the same prebuilt content each time the page is loaded.

Dynamic web pages contain server side or client side code which allows the server to generate unique content each time the page is loaded.

Static Web Pages

Dynamic Web Pages

Page 16: DITEC - E-Commerce & ASP.NET

Creating Dynamic Web Pages

• Client Side Scripting• Server Side Scripting

Page 17: DITEC - E-Commerce & ASP.NET

Client Side Scripting

Client side scripting enables you to develop web pages that can dynamically respond to the user input without having an interact with web server.

Page 18: DITEC - E-Commerce & ASP.NET

Server Side Scripting

Server side scripting provides dynamic content to users based on the information stored in a remote location such as a back end database.

Page 19: DITEC - E-Commerce & ASP.NET

What is ASP.NET ?

ASP.NET is a server-side Web application framework designed for Web development to

produce dynamic Web pages.

Page 20: DITEC - E-Commerce & ASP.NET

What you can do with ASP.NET ?

ASP.NET was developed by Microsoft to allow programmers to build dynamic web sites, web

applications and web services.

Page 21: DITEC - E-Commerce & ASP.NET

How ASP.NET Works ?

1. When a browser requests an asp.net file, IIS passes the request to the ASP.NET Engine on the server.

2. Then asp.net engine read the file line by line and execute the scripts in the file.

3. Finally the ASP.NET file is returned to the browser as a plain HTML file.

.ASPX

CompiledCode

Request (http://www.website.com)

Response (website page)

IIS Server

Page 22: DITEC - E-Commerce & ASP.NET

Features of ASP.NET

Compiled CodeEnriched Tool SupportPower and FlexibilitySimplicityManageability, Scalability and Security

Page 23: DITEC - E-Commerce & ASP.NET

ASP.NET Web Forms

• Web Forms is an ASP.NET programming model, with event driven web pages written as a combination of HTML, server controls, and server code.

• Web Forms are compiled and executed on the server, which generates the HTML that displays the web pages.

• All server controls must appear within a <form> tag in the Web Form.

Page 24: DITEC - E-Commerce & ASP.NET

Controls in Web Forms

We use several type of controls in Web Forms

• HTML Controls• Server Controls• HTML Server Controls

Page 25: DITEC - E-Commerce & ASP.NET

HTML Controls

These are the basic HTML elements.

Some of them you know…

<p>this is a paragraph</p><a href=“http://google.com”>Google</a>

<img src=“images/Car.jpg” />

Page 26: DITEC - E-Commerce & ASP.NET

Server Controls

Server controls are tags that are understood by the server.

The syntax of a Web server control is:

<asp:control_name id="some_id" runat="server" />

Button, Label, Calendar, HyperLink, Etc.

Page 27: DITEC - E-Commerce & ASP.NET

HTML Server Controls

To make HTML elements programmable like a server control, add a runat="server" attribute

to the HTML element.

This attribute indicates that the element should be treated as a server control.

<img scr=“images/Car.jpg” id=“img1” runat=“server”/>

Page 28: DITEC - E-Commerce & ASP.NET

Event Handlers

An Event Handler is a subroutine that executes code for a given event.

Examples:When a Button clicksWhen an item selects from a ListBoxWhen a page loading

Page 29: DITEC - E-Commerce & ASP.NET

The Page Load Event

The page Load event is triggered every time when a page loads.

protected void Page_Load(object sender, EventArgs e) {

}

Page 30: DITEC - E-Commerce & ASP.NET

IsPostBack Property

Gets a value that indicates whether the page is being rendered for the first time or is being loaded in

response to a postback.

protected void Page_Load(object sender, EventArgs e) {

if (IsPostBack) {

Response.Write(“Hi"); }

}

Page 31: DITEC - E-Commerce & ASP.NET

Navigation by using Response Class

The redirect method on Response class use to redirect the user to another web page.

protected void btnGo_Click(object sender, EventArgs e) { Response.Redirect(“AboutUs.aspx”); }

Page 32: DITEC - E-Commerce & ASP.NET

Passing Values from Page to Another

Roshan|Name: Enter

Welcome Roshan

Welcome.aspx

Main.aspx

Page 33: DITEC - E-Commerce & ASP.NET

Passing Values from Page to Another

protected void btnEnter_Click(object sender, EventArgs e) { Response.Redirect(“Main.aspx?name=" + txtName.Text); }

protected void Page_Load(object sender, EventArgs e) { Response.Write("Welcome " + Request.QueryString["name"]); }

Welcome.aspx

Main.aspx

Page 34: DITEC - E-Commerce & ASP.NET

Passing Values from Page to Another

protected void btnEnter_Click(object sender, EventArgs e) { Session["name"] = txtName.Text; Response.Redirect(“Main.aspx"); }

protected void Page_Load(object sender, EventArgs e) { Response.Write("Welcome " + Session["name"].ToString()); }

Welcome.aspx

Main.aspx

Page 35: DITEC - E-Commerce & ASP.NET

Data Binding to a Drop Down List

SqlConnection con = new SqlConnection("Data Source=.\\SQLEXPRESS; Initial Catalog=studentdb; Integrated Security=true");

protected void Page_Load(object sender, EventArgs e){

con.Open();SqlDataAdapter da = new SqlDataAdapter(“SELECT * FROM tblStudent", con);DataSet ds = new DataSet();da.Fill(ds, "tblst");DropDownList1.DataSource = ds;DropDownList1.DataValueField = "ID";DropDownList1.DataTextField = "Name";DropDownList1.DataBind();con.Close();

}

Page 36: DITEC - E-Commerce & ASP.NET

The End

http://twitter.com/rasansmn