# SQL SERVER 2000 STEP BY STEP

Document Sample

```					                            ASP.Net

The Body Mass Index (BMI)
Problem
ASP.Net

Contents

A. BMI Problem
B. Solution

Tuesday, June 08, 2010          2
ASP.Net

A. BMI Problem

 Develop a web application that reads the weight and the
height of a person and then displays his/her weight status.
(See the next slide for an example)
 The weight status is categorized based on the value of Body
Mass Index:

•     The BMI value should be rounded with one decimal place.
 Following are definitions of weight status for adults used by
the WHO:

Tuesday, June 08, 2010                                                                  3
ASP.Net

Tuesday, June 08, 2010        4
ASP.Net

B. Solution

1. Creating a .aspx web page
2. Designing web form interface
3. Calculating body weight status
4. Running & Testing

Tuesday, June 08, 2010                           5
ASP.Net

1. Creating a .aspx web page

1.1 Starting Microsoft Visual Studio 2005
1.2 Creating a new web site
1.3 Creating new web form

Tuesday, June 08, 2010                                     6
ASP.Net

1.1 Starting Microsoft Visual Studio 2005

Tuesday, June 08, 2010                                           7
ASP.Net

1.2 Creating new web site
ASP.Net

Name of a web site
ASP.Net

1.3 Creating new web form

Name web form
Using code behind

Choose Program
Tuesday, June 08, 2010      language                                          10
ASP.Net

2. Designing web interface

2.1 Web form layout
2.2 Developing the web form

Tuesday, June 08, 2010
11
ASP.Net

2.1 Web form layout

 Table                                  Input area   BMI info
 Columns = 3
 Input area: Columns 1 & 2
 BMI title literal
 Literal & text box for weight
 Literal & text box for height
 Literal & BMI label to
display BMI number
 Weight status result label
 BMI info: Column 3
 BMI formula image
 Weight status image
ASP.Net

2.2 Developing the web form

 2.2.1 Creating table
 2.2.2 Designing input area
 2.2.3 Designing BMI info
ASP.Net

2.2.1 Creating table

 Inserting new HTML table

Tuesday, June 08, 2010                            14
ASP.Net

Choose a row and right click to insert new row
ASP.Net

2.2.2 Designing input area
 2.2.2.1 Adding BMI title literal
 2.2.2.2 Adding literal & text box for weight
 2.2.2.4 Adding literal & BMI label
ASP.Net

Type the BMI title
ASP.Net

2.2.2.2 Adding literals & text box for weight

Click TextBox at Toolbar
and drag to web form

Right click to the text box and
change ID to txtWeight

Doing the same to add literals & text box for height

Tuesday, June 08, 2010                                                  18
ASP.Net

• Button ID: btnGetBMI
• Button text: Get Your BMI

Tuesday, June 08, 2010                                   19
ASP.Net

2.2.2.4 Adding literal & BMI label

• Label ID: lblBMI
• Label text: blank

Tuesday, June 08, 2010                                   20
ASP.Net

• Label ID: lblResult
• Label text: blank
ASP.Net

2.2.3 Designing BMI info

 2.2.3.1 Adding images to web site
 2.2.3.2 Displaying BMI formula & body weight
status images
ASP.Net

2.2.3.1 Adding images to web site

Creating image folder in a web site
ASP.Net

Tuesday, June 08, 2010                                  24
ASP.Net

2.2.3.2 Displaying BMI formula
& body weight status images

 Add BMI formula image to Images folder and drag it to web form

 Same for weight status image

Tuesday, June 08, 2010                                                          25
ASP.Net

3. Calculating body weight status

3.1 Going to code page
3.2 Coding for body weight status

Tuesday, June 08, 2010                               26
ASP.Net

3.1 Going to code page

view code
ASP.Net

3.2 Coding for body weight status

Double click to Get BMI Button and write code as below:

Tuesday, June 08, 2010                                                 28
ASP.Net

Tuesday, June 08, 2010       29
ASP.Net

Tuesday, June 08, 2010       30
ASP.Net

4. Running & Testing

4.1 Running with the debugging enabled
4.2 Running without debugging
4.3 Testing

Tuesday, June 08, 2010                                 31
ASP.Net

4.1 Running with the debugging enabled

There are a virtual web server. Therefore, we don’t need IIS to run a .aspx web
page
Every time we run a web page in virtual web server, it will run with a random port

Tuesday, June 08, 2010                                                                     32
ASP.Net

4.2 Running without debugging

Tuesday, June 08, 2010                            33
ASP.Net

4.3 Testing

Tuesday, June 08, 2010          34
ASP.Net

References

E-book:
Wrox.Professional.ASP.NET.2.0.Nov.2005
Bill Evjen
Scott Hanselman
Srinivasa Sivakumar

Tuesday, June 08, 2010                                    35

```
DOCUMENT INFO
Shared By:
Categories:
Stats:
 views: 15 posted: 6/9/2010 language: English pages: 35
How are you planning on using Docstoc?