Sunteți pe pagina 1din 78

Lesson No.

1 Web Publishing - Frames


1.Web Publishing – Creation of web sites/web pages and storing them on Web servers on Internet
for viewing to public.

– It is a high configuration computer on Internet that stores web sites and serves web pages to
clients on request.

2.Web Browser – It is a software program used to browse web pages. E.g Chrome, IE, Opera,
Netscape navigator, Mozilla Firefox

3.Web site – It is a collection of web pages on a particular subject e.g. www.nasa.gov

4.Homepage – The first web page that is displayed when you visit a website.

FRAMES-
-It is used to divide the browser window into several parts through which we can see more than one
web page at a time.

-Each HTML document is called frame.

To create frames tags used are:

<frameset>

<frame>

E.g.

<HTML>

<HEAD>

<TITLE>frame example</TITLE>

</HEAD>

<frameset rows="25%,50%,25%">

<frame src="web1.htm">

<frame src="web2.htm">

<frame src="web3.htm">

</frameset>

</HTML>

About <frameset> tag-


- <frameset> tag is a container tag for defining frames.
- It replaces the <body> tag in frameset documents

- It defines how to divide the window into frames.

- Each frameset defines a set of rows or columns.

- To divide screen horizontally we use rows.

- To divide screen vertically we use cols

- The rows/cols values indicate the amount of screen area, each row/column will occupy

Attributes of frameset tag-


i) Rows - It divides the screen into horizontal frames.

ii) Cols - It divides the screen into vertical frames.

Values of area can be given in % or pixels or by relative value using * (asterisk) symbol.

About <frame> tag-


- It is used to create frame within frameset.

- It defines what HTML document to put into the frame.

Attributes of <frame>-
Name – assigns a name to the frame.

Src – specifies the html page you want to display.

Frameborder - specifies the border around frame. By default value is 1. 0 value for no border.

Marginwidth – sets left an right margins.

Marginheight – sets top and bottom margins.

Noresize - This attribute prevents the user from resizing the frame.

Scrolling – specifies whether to display scrollbar. It can have one of the three values - YES, NO,
AUTO.

<noframes> tag-
The <noframes> tag is a fallback tag for browsers that do not support frames. It can contain all the
HTML elements that you can find inside the <body> element of a normal HTML page.

The <noframes> element can be used to link to a non-frameset version of the web site or to display
a message to users that frames are required.

The <noframes> element goes inside the <frameset> element.

Example:

<html>
<head>

<title>HTML noframes Tag</title>

</head>

<body>

<frameset cols="200, *">

<frame src="/html/menu.htm" name="menu_page">

<frame src="/html/main.htm" name="main_page">

<noframes>

<body> Your browser does not support frames. </body>

</noframes>

</frameset>

</body>

</html>

<iframe> tag -
-An inline frame is a frame that is displayed in a box within a web page.

-<iframe> tag is used to create inline frame. The inline frame can display images or web pages
within it.

Attributes :
Attribute Value Description

src URL Specifies the address of the document to embed in the <iframe>

Left / right / top


align Specifies the alignment of an <iframe> according to surrounding elem
middle / bottom

frameborder 1 / 0 Specifies whether or not to display a border around an <iframe>

height pixels Specifies the height of an <iframe>

longdesc URL Specifies a page that contains a long description of the content of an <

marginheight pixels Specifies the top and bottom margins of the content of an <iframe>

marginwidth pixels Specifies the left and right margins of the content of an <iframe>

name text Specifies the name of an <iframe>

scrolling Yes /no /auto Specifies whether or not to display scrollbars in an <iframe>

width pixels Specifies the width of an <iframe>


Target attribute used in <a> tag -
Magic target names are target names that will open the link in different frames/window.

Target="_self" - opens the page in same window

Target="_blank" - opens the page in new blank Window.

Target="_top" - opens the page in top frame.

Target="_parent" - opens the page in parent frame.


IMAGE MAPPING-
It is a single graphic image that consists of number of hyperlinks incorporated
within an image.
The specific areas mapped within an image are known as hotspots which are
links to a resource.
Map is a text file that contains the information of an image and the mapped
areas of an image.
These areas can be rectangles, circles or polygons defined in an image specified
by coordinates in pixels of the image.
There are two ways to do image mapping
1) Client Side mapping - They are executed on client machine from web browser
itself. All information is loaded along with the image. It executes quickly.
2) Server side mapping - In this the program that executes the links is placed on
the server. The browser activates program on the server by sending x and y
coordinates of the position where hyperlink was created.

Client Side mapping


In Client side mapping, the image map is mentioned by
using USEMAP attribute in the <img> tag. The map is specified in
the <map> and <area> tags, which defines the hotspot in an image.
For specifying the areas of the hotspot, the <area> tag is used within <map> tag.

The attributes for <area> tag are as follows:


shape :- specifies as values rect, circle and poly

1. rect - for defining rectangle area, upper left and right bottom (X,Y)
coordinates.

2. circle - for defining circle area, coordinates of center point and radius is
specified.
3. poly - for defining polygon area, 3 or more pair of coordinated to form
polygon

coords :- specifies coordinates for rectangle, circle and polygon


href :- specifies path of html file or URL of website.
alt :- specifies alternate text given to hotspot
E.g. Client side image mapping
mapexample.html

<html>
<body>
<img src="images/globe.jpg" usemap="#test">

<map name="test">
<area shape="rect" coords="22,37,123,97" href="page1.html">
<area shape="circle" coords="406,38,30" href="page2.html">
<area shape="poly" coords="48,169,142,234,50,248" href="page3.html">
</map>
</body>
</html>

The coordinates for the shape are found by opening the globe.jpg
picture in Paint by placing the arrow over the points and note down the
coordinates.

Server Side mapping


In Server side mapping the map details are placed on the server. The browser
activates program on the server by sending x and y coordinates of the position
where the hyperlink was created. On receiving the coordinates the program on
the server looks at the map file for close match and then loads the file that is
closet to coordinates.

In Server side mapping, the image map is mentioned by using ISMAP attribute
in the <img> tag.

The map details are save in a text file with the extension .map and place this file
in the same folder in which html document containing the image is placed.

E.g. Server side image mapping - the map is written in globe.map file
which is placed on server

globe.map

Default http://exza.in/xyz.html
Rect http://exza.in/page1.html 22,37,123,97
Circle http://exza.in/page2.html 286, 90, 45
Poly http://exza.in/page3.html 48,169,142,234,50,24
mapexample.html

<html>
<body>
<a href="http://exza,in/globe.map> <img src="images/globe.jpg" ISMAP> </a>

</body>
</html>

The href attribute of <a> tag specifies the location of external map file and
server side image map program on the web server. The <img> tag is reference
for the mapped file. The ISMAP attribute in the <img> tag specifies that the
image is mapped file. ISMAP indicates a server side image map.
FORMS

-Forms are used to accept or input the data from user. The form consists of objects called
form elements.
E.g. Text box, Password box, Radio button, List box, Command button, submit button, Drop
list box, Check box, etc.

-To create forms, <form> tag is used. All the elements are placed within <form> </form>
tags.
-<input> tag: Used to create the form fields.

-Textbox or Text input field


Used to input text in a single line.
E.g. <input type=text name="fname">

-Password field
Used to type password (displays * or . )
E.g. <input type=password name="pwd">

-Submit button
Creates submit button, used to send form data to server for processing.
E.g. <input type=submit value="submit">

Example - Simple LOGIN form


<html>
<head>
<title>Login Form</title>
</head>
<body>
<h1> User Login</h1>
User ID: <input type=text name="loginid" size=15>
<br><br>
Password: <input type=password name="pwd">
<br><br>
<input type=submit value="login">
</body>
</html>

Radio button
It's a toggle button and only one option can be selected from a group of radio buttons.
E.g. <input type=radio name=gender value="M">
<input type=radio name=gender value="F">

Check box
Used to select one or more options from number of choices
E.g. <input type=checkbox name=hobby value="Cri">
<input type=checkbox name=hobby value="Bas">
Button field
It is used to display a command button to which we can assign a function (task).
Clicking the button will activate a function.
E.g. <input type=button name=button1 onclick="function();">

Attributes of <input> tag:


1.Name - assigns a name to form field.
2.Size - specifies the display size of a text box
3.Maxlength - limits the number of character that a user can enter in a text field.
4.Value - It is used to assign a default value to text box.
5.Type - It indicates the type of form objects like text (default), radio, submit, reset,
checkbox, etc.
6.Checked - It is used to specify default selection for radio button and check box.
id - used to provide a id to the field (used in CSS)

Select list box or Drop down list box


The <select> tag is used to select an option from menu kind of drop-down list or scrolling list
box.
E.g.
<select name=city>
<option value=mum>Mumbai</option>
<option value=thn>Thane</option>
<option value=kyn>Kalyan</option>
</select>
Attributes of <select>:
Name - It is used to specify a name to the select box. Assigns a label to selection.
Size - Specifies the number of list items to be displayed at one time.
Multiple - Allows the user to select multiple options.

<textarea> tag
It is used to create multiline textbox or large editable area.
E.g.
<textarea rows=3 cols=40>

</textarea>
Attributes of <textarea> tag:
Name - assigns a name to the text area
Rows - specifies the height of the text area in number of lines.
Cols - specifies the width of the text area in no. of columns /characters.
Hidden field
The purpose of the hidden field is to store the value that need to be sent to server along with
form. The browser does not display these values.
E.g. <input type=hidden name=xyz value=256>
Attributes of <form> tag:
Method - It specifies the method of sending form data to the server.
There are two methods:
GET - It appends the data to the URL in name/value pairs.
POST - sends the form data hidden in HTTP headers not visible on the screen.
Action - It specifies the location/path or URL of the server where the form data is to be
submitted.
Name - assigns a name to the form.
E.g.
<form method=post name=form1 action="http://www.exza.in/getdata.php">
Inserting Sound and Video into Web page -
Popular Sound/Audio formats:
.WAV - developed by Microsoft and IBM. It is the standard format for Windows.
.AIFF - (Audio Interchange File Format) developed by Apple for MAC platform
.Ra - (Real Audio Format) is lower quality audio format (smaller in size)

.MP3 - MP3 (MPEG-1 Audio Layer-3) is a standard technology and format for compressing
a sound sequence into a very small file (about one-twelfth the size of the original file) while
preserving the original level of sound quality when it is played. MP3 provides near CD quality
audio.

.AU - (Audio) developed by Sun Microsystems for UNIX platform


.MIDI - (Musical Instrumental Digital Interface) - format used for instrumental music, very
small in size
.RMF - It is a wrapper for audio formats like .wav, .au, .aiff, .mp3 and MIDI. The purpose of
the format is to encrypt the data and to store MIDI and sounds together.

Linking to audio file


We can use <a> tag to link an audio resource on your computer or web.
E.g.
<a href="music/background.mp3">
Click here to play
</a>

Adding sound/audio to web pages


<bgsound>
To add background sound to html pages <bgsound> tag is used.
It is supported by only Internet Explorer
It has no control attribute (play, stop, pause buttons)
e.g.
<bgsound src="music/background.wav" loop=2>

Attributes:
Src - specify the name of audio file
Loop - specifies the number of times the file must be played.
E.g. loop="infinite" or loop=-1
loop=2

<embed> tag
It is used to insert audio as well as video both.
It provides console for controlling.
E.g. <embed src="music/quit.mp3" height=100
Width=200>
Attributes of <embed> tag:
Src - Specifies the name of audio or video file.
Autostart - specifies whether audio should start on page load. It has two values true or
false.
True value plays music when page is loaded.
False value will play music when user clicks play button.
Hidden - It is to hide the console. True value hides the console.
Volume - Sets the volume of music. Values from 1 to 100 can be set. Default is 50.
Width - specifies the width of the console.
Height - specifies the height of the console.
Controls - specifies console size Values - console or small consoles
Value console gives the complete console with play, stop and pause button.

Video formats
.AVI (Audio Video Interleave) - format developed by Microsoft for Windows platform.
.WMV (Windows Media video) - developed by Mircosoft
.QT (Quick Time) - format developed by Apple for MAC platform
.MPG / .MPEG / .MP4 - formats developed by Moving Picture experts group, popular
format on web.
.flv - developed by Adobe Flash (low quality)

Adding video to the web page


<embed> tag is used to insert video on the web page.
E.g.
<embed src="videos/sample.mp4" height=480 width=640>

Adding video using <img> tag


<img> tag along with DYNSRC attribute is used to insert video in the web page.
E.g. <img DYNSRC="videos/sample.mp4" height=480 width=640>
Creation of Web Content using Indian Languages-

By using Unicode and Indian language fonts Arial Unicode MS and Mangal
About Unicode:
Unicode is a computing industry standard for the consistent encoding,
representation, and handling of text expressed in most of the world's writing
systems.
It is a standard character set encoding developed and maintained by The
Unicode Consortium.
It can support over one million characters.
It supports all characters from all scripts, as well as many symbols.
Unicode also knows as UTF-8 (Unicode Transformation Format-8) or the
Universal Alphabet.
Today all the web browser and operating systems includes Unicode support.
Steps for language settings in Windows
1. Go to Control Panel
2. Click on Clock, Language and Regional.

3. Click on Change Keyboards or Other Input Methods options.


4. In "Keyboards and Languages" box click on Change keyboards option.

5. In the "Text Services and Input Languages" window, in the General tab,
click on Add button.
6. In the Add Input Language window, Search for your required indian
language and click the plus sign to open.

7. Now click the plus sign to open Keyboard option and click on Devnagari In
script checkbox.
8. Click on the OK button.
9. Now in the Text Services and Input Languages, click the Default Input
Languages option and click on the selected language e.g. Marathi - Devnagari
Inscript option.

10. Click on the Apply button.


11. Now in Language bar, choose the option Docked in Taskbar to display the
Language bar on Taskbar of Windows Desktop.

12. Click on the Apply button and Click OK.


13. Now you can type in the indian language by selection the option from the
Language bar displayed on the Taskbar.
Open Notepad and Type the text in <body> section by changing the language
from the language bar.
While saving the file, select encoding as UNICODE in the Save As dialog box.
Cross Browser Testing-
Introduction
With wide range of web browsers available, end users using different web
browsers to access your web site/applications, it has now become crucial to test
web site/applications on multiple browsers. On different browsers, client
components like HTML, JavaScript, AJAX requests, Applets, Flash, etc. may
behave differently.

Testing your website on different browsers is knows as Cross


Browser Testing.
Cross Browser Testing is a process to test web applications across multiple
browsers.
-It involves checking compatibility of your application across multiple web
browsers and ensures that your web application works correctly across different
web browsers.
-It involves testing both the client side and server side behavior of your Web
application when it is accessed using different Web Browsers.
-It shows limitation of the web site and functional features.
Some Popular Browsers:

In every browser and platform the website will look and work differently.
Every web browser comes with variations and differences in the way a web
page is displayed and works.

Examples:

1. <bgsound> tag is only supported by Internet Explorer and not by Netscape


Navigator, Chrome, Firefox, Opera, etc..
2. Broken image - an image in a web page whose path is not found or path is
wrong or file name is given is wrong. Internet Explorer shows broken images
with a red color sign along with alternative text. In Netscape Navigator, it
shows 3 color dots with alternative text.
3. <hr> tag Horizontal rule - The appearance is different in browsers. In
Internet Explorer it shows 3D effect, whereas in Netscape Navigator it show
rule (line) in regular manner.
4. bordercolorlight and bordercolordark - attributes of <table> tag are
supported in Internet Explorer but not supported in Netscape Navigator.
5. bgproperties=fixed - This attribute used in <body> tag makes background
image water marked in Internet Explorer, but moves with text in Netscape
Navigator.
6. Outset Border - Outset border style given to paragraph tag is shown in
Internet Explorer and not in Netscape navigator.
7. <blink> tag is not supported in Internet Explorer and other browsers which
blinks the text, but supported in Netscape Navigator.
What is CSS?
 CSS stands for Cascading Style Sheets
 CSS describes how HTML elements are to be displayed on screen, paper, or in
other media
 CSS saves a lot of work. It can control the layout of multiple web pages all at once
 CSS is used to define styles for your web pages, including the design, layout and
variations in display for different devices and screen sizes.
 External stylesheets are stored in CSS files

CSS SYNTAX
A CSS rule-set consists of a selector and a declaration block:

 The selector points to the HTML element you want to style.


 The declaration block contains one or more declarations separated by semicolons.
 Each declaration includes a CSS property name and a value, separated by
a colon.
 A CSS declaration always ends with a semicolon, and declaration blocks are
surrounded by curly braces.

Example:
p{
color: red;
text-align: center;
}

Three Ways to Insert CSS


There are three ways of inserting a style sheet:
1. External style sheet 3. Inline style
2. Internal style sheet
1. EXTERNAL STYLE SHEET
With an external style sheet, you can change the look of an entire website by changing just
one file!
Each page must include a reference to the external style sheet file inside the <link> element.
The <link> element goes inside the <head> section:
An external style sheet can be written in any text editor. The file should not contain any html
tags. The style sheet file must be saved with a .css extension.
Example:
<head>
<link rel="stylesheet" type="text/css" href="mystyle.css">
</head>

Here is how the "myStyle.css" looks:


body {
background-color: lightblue;
}

h1 {
color: navy;
margin-left: 20px;
}

Note: Do not add a space between the property value and the unit (such as margin-
left:20 px;). The correct way is: margin-left:20px;

2. INTERNAL STYLE SHEET


An internal style sheet may be used if one single page has a unique style.
Internal styles are defined within the <style> element, inside the <head> section of an HTML
page:
Example:
<head>
<style>
body {
background-color: linen;
}

h1 {
color: maroon;
margin-left: 40px;
}
</style>
</head>
3. INLINE STYLES

An inline style may be used to apply a unique style for a single element.
To use inline styles, add the style attribute to the relevant element. The style attribute can
contain any CSS property.
The example below shows how to change the color and the left margin of a <h1> element:
Example:
<h1 style="color:blue;margin-left:30px;">This is a heading.</h1>

Note: If some properties have been defined for the same selector (element) in different style
sheets, the value from the last read style sheet will be used.

CSS SELECTORS
CSS selectors are used to "find" (or select) HTML elements based on their element name,
id, class, attribute, and more.
THE ELEMENT SELECTOR
The element selector selects elements based on the element name.
Example:

p{
text-align: center;
color: red;
}

THE ID SELECTOR
 The id selector uses the id attribute of an HTML element to select a specific element.
 The id of an element should be unique within a page, so the id selector is used to select one
unique element!
 To select an element with a specific id, write a hash (#) character, followed by the id of the
element.
Example:
#para1 {
text-align: center;
color: red;
}
<p id="para1">
.....................................................
...................................................
</p>
THE CLASS SELECTOR
 The class selector selects elements with a specific class attribute.
 To select elements with a specific class, write a period (.) character, followed by the name
of the class.

Example:
.center {
text-align: center;
color: red;
}

GROUPING SELECTORS
If you have elements with the same style definitions, it will be better to group the selectors, to
minimize the code.
To group selectors, separate each selector with a comma.
Example:
h1, h2, p {
text-align: center;
color: red;
}
Lesson No. 1 Web Publishing Short Ques.
Answers
Lesson No. 1 Web Publishing

1. What do you mean by Frames. Explain <frame>, <frameset> and <noframe>


tags.
FRAMES are used to divide the browser window into several parts through which we
can see more than one web page at a time. Each HTML document is called frame.
A frame is an individual, independently scrolling region of a web page.
To create frames, tags used are: 1. <frameset> 2. <frame>

<frameset> tag
 It is a container tag for defining frames.
 It replaces the <body> tag in frameset documents
 It defines how to divide the window into frames.
 Each frameset defines a set of rows or columns.
 To divide screen horizontally we use rows.
 To divide screen vertically we use cols.

The rows/cols values indicate the amount of screen area, each row/column will
occupy
Attributes of frameset tag
i) Rows : It divides the screen into horizontal frames.
ii) Cols : It divides the screen into vertical frames.
Values of area can be given in % or pixels or by relative value using * (asterisk)
symbol.

<frame> tag
It is used to create frame within frameset. It defines what HTML document to put into
the frame.
Attributes of <frame>
Name : assigns a name to the frame.
Src : specifies the html page you want to display.
Frameborder : specifies the border around frame. By default value is 1. 0 value for
no border.
Marginwidth : sets left an right margins.
Marginheight : sets top and bottom margins.
Noresize : This attribute prevents the user from resizing the frame.
Scrolling : specifies whether to display scrollbar. It can have one of the three values :
YES, NO, AUTO.

<noframes> tag
The <noframes> tag is a fallback tag for browsers that do not support frames. It can
contain all the HTML elements that you can find inside the <body> element of a
normal HTML page.
The <noframes> element can be used to link to a non:frameset version of the web
site or to display a message to users that frames are required.
The <noframes> element goes inside the <frameset> element.

2. Explain the <iframe> tag along with its attributes.


An inline frame is a frame that is displayed in a box within a web page. <iframe> tag
is used to create inline frame. The inline frame can display images or web pages
within it.
Attributes of <iframe>
Attribute Value Description
Specifies the address of the document to embed in the
src URL
<iframe>
Left / right / top Specifies the alignment of an <iframe> according to
align
middle / bottom surrounding elements
Specifies whether or not to display a border around
frameborder 1 / 0
an <iframe>
height pixels Specifies the height of an <iframe>
Specifies a page that contains a long description of
longdesc URL
the content of an <iframe>
Specifies the top and bottom margins of the content
marginheight pixels
of an <iframe>
Specifies the left and right margins of the content of
marginwidth pixels
an <iframe>
name text Specifies the name of an <iframe>
Specifies whether or not to display scrollbars in an
scrolling Yes /no auto
<iframe>
width pixels Specifies the width of an <iframe>

3. Explain <img> tag along with its attributes.


The <img> tag is used to insert image on a web page. The various attributes of
<img> tag are as follows:
Src – Specifies the location of the image.
Alt – provides alternate text for the image. If the image is not loaded in the web page
alternate text is displayed.
Height – Specifies the height of the image given in pixels or percentage.
Width – specifies the width of the image given in pixels or percentage.
Border – Specifies the width of the border around an image.
Align – specifies the alignment of the image. The values are left, center or right.
Hspace – Specifies the amount of white space to be left on left and right side of an
image.
Vspace – Specifies the amount of white space to be left on top and bottom side of an
image.

4. Explain Image Mapping. Explain its two types.


IMAGE MAPPING
It is a single graphic image that consists of number of hyperlinks incorporated within
an image. The specific areas mapped within an image are known as hotspots which
are links to a resource.
Map contains the information of an image and the mapped areas of an image. These
areas can be rectangles, circles or polygons defined in an image specified by
coordinates in pixels of the image.

There are two ways to do image mapping

1) Client Side mapping : They are executed on client machine from web browser
itself. All information is loaded along with the image. It executes quickly. In Client
side mapping, the image map is mentioned by using USEMAP attribute in the
<img> tag. The map is specified in the <map> and <area> tags, which defines the
hotspot in an image. For specifying the areas of the hotspot, the <area> tag is used
within <map> tag.

2) Server side mapping : In this the program that executes the links is placed on
the server. The browser activates program on the server by sending x and y
coordinates of the position where hyperlink was created. On receiving the
coordinates the program on the server looks at the map file for close match and then
loads the file that is closet to coordinates. In Server side mapping, the image map is
mentioned by using ISMAP attribute in the <img> tag. The map details are save in a
text file with the extension .map and place this file in the same folder in which html
document containing the image is placed.

5. Explain forms and list the different tags used to construct web form.
A webform, web form or HTML form on a web page allows a user to enter data that
is sent to a server for processing. Forms can resemble paper or database forms
because web users fill out the forms using checkboxes, radio buttons, or text fields.
The HTML <form> element defines a form that is used to collect user input. An
HTML form contains form elements.
Form elements are different types of input elements, like text fields, checkboxes,
radio buttons, submit buttons, and more.
The list of different tags used to create form elements are:

<form> </form> : container tag for all form elements


<input> tag : To create textbox, password field, radio button, buttons, check box,
submit button, reset button using the type attribute. HTML5 added several new input
types: color,date, datetime-local, email, month, number, range, search, tel, time, url,
week, etc..
<textarea> </teaxtarea> : To create multiline text box. The size of a text area can
be specified by the cols and rows attributes, or even better; through CSS' height and
width properties.
<select> : used to create a drop-down list. The <option> tags inside the <select>
element define the available options in the list.

6. Explain popular audio formats.


Popular Sound/Audio formats:
.WAV - developed by Microsoft and IBM. It is the standard format for Windows.
.AIFF - (Audio Interchange File Format) developed by Apple for MAC platform
.Ra - (Real Audio Format) is lower quality audio format (smaller in size)
.MPEG/.MPG - (Moving Picture Experts Group) popular format used for web.
Smaller in size but good quality
.AU - (Audio) developed by Sun Microsystems for UNIX platform
.MIDI - (Musical Instrumental Digital Interface) - format used for instrumental music,
very small in size

7. Explain popular video formats.


Popular Video formats:
.AVI (Audio Video Interleave) - format developed by Microsoft for Windows platform.
.WMV (Windows Media video) - developed by Mircosoft
.QT (Quick Time) - format developed by Apple for MAC platform
.MPG / .MPEG / .MP4 - formats developed by Moving Picture experts group, popular
format on web.
.flv - FLV is a file format used by Adobe Flash Player and Adobe AIR for storing and
delivering synchronized audio and video streams.
.swf - is a file extension for a Shockwave Flash file format created by Macromedia
and now owned by Adobe. SWF stands for Small Web Format. SWF files can
contain video and vector based animations and sound and are designed for efficient
delivery over the web. SWF files can be viewed in a web browser using the Flash
plug in.

8. What is Cross Browser and give examples.


Testing your website on different browsers is knows as Cross Browser
Testing. Cross Browser Testing is a process to test web applications across multiple
browsers. It involves checking compatibility of your application across multiple web
browsers and ensures that your web application works correctly across different web
browsers. It involves testing both the client side and server side behavior of your
Web application when it is accessed using different Web Browsers. It shows
limitation of the web site and functional features.
Examples:
1. <bgsound> tag is only supported by Internet Explorer and not by Netscape
Navigator, Chrome, Firefox, Opera, etc..

2. Broken image - an image in a web page whose path is not found or path is wrong
or file name is given is wrong. Internet Explorer shows broken images with a red
color sign along with alternative text. In Netscape Navigator, it shows 3 color dots
with alternative text.

3. <hr> tag Horizontal rule - The appearance is different in browsers. In Internet


Explorer it shows 3D effect, whereas in Netscape Navigator it show rule (line) in
regular manner.

4. bordercolorlight and bordercolordark - attributes of tag are supported in


Internet Explorer but not supported in Netscape Navigator.
5. bgproperties=fixed - This attribute used in tag makes background image water
marked in Internet Explorer, but moves with text in Netscape Navigator.
6. Outset Border - Outset border style given to paragraph tag is shown in Internet
Explorer and not in Netscape navigator.
7. <blink> tag is not supported in Internet Explorer and other browsers which blinks
the text, but supported in Netscape Navigator.

9. What is Unicode?
 Unicode is a computing industry standard for the consistent encoding,
representation, and handling of text expressed in most of the world's writing systems.
 It is a standard character set encoding developed and maintained by The Unicode
Consortium.
 It can support over one million characters.
 It supports all characters from all scripts, as well as many symbols.
 Unicode also knows as UTF-8 (Unicode Transformation Format-8) or the Universal
Alphabet.
 Today all the web browser and operating systems includes Unicode support.

10. What is CSS? Explain ways to include CSS in web pages.


 CSS stands for Cascading Style Sheets, used for styling of a web page.
 CSS describes how HTML elements are to be displayed on screen, paper, or in
other media
 CSS saves a lot of work. It can control the layout of multiple web pages all at once
 CSS is used to define styles for your web pages, including the design, layout and
variations in display for different devices and screen sizes.

There are three ways of inserting a style sheet:


1) External style sheet
With an external style sheet, you can change the look of an entire website by
changing just one file!
Each page must include a reference to the external style sheet file inside the <link>
element. The <link> element goes inside the <head> section:
An external style sheet can be written in any text editor. The file should not contain
any html tags. The style sheet file must be saved with a .css extension.
Example:
<head>
<link rel="stylesheet" type="text/css" href="mystyle.css">
</head>
Here is how the "myStyle.css" looks:
body { background-color: lightblue; }

h1 {
color: navy;
margin-left: 20px;
}
2) Internal style sheet
An internal style sheet may be used if one single page has a unique style.
Internal styles are defined within the <style> element, inside the <head> section of
an HTML page:
Example:
<head>
<style>
body { background-color: linen; }

h1 {
color: maroon;
margin-left: 40px;
}
</style>
</head>
3) Inline style
An inline style may be used to apply a unique style for a single element.
To use inline styles, add the style attribute to the relevant element. The style attribute
can contain any CSS property.
The example below shows how to change the color and the left margin of a <h1>
element:
Example:
<h1 style="color:blue;margin-left:30px;">This is a heading.</h1>

11. What is Web Server?


A Web server is a program running on a Computer that uses HTTP (Hypertext
Transfer Protocol) to serve the files that form Web pages to users, in response to
their requests, which are forwarded by their computers' HTTP clients (Web
Browsers).
Web server is a computer that hosts websites and web pages i.e. where the web
content is stored.
A web server consists of a physical server, server operating system (OS) and
software used to facilitate HTTP communication like IIS, Apache, etc.
When you type a Web site address into your browser, Web servers are doing the
work of getting you the page you request.

Every Web server has an IP address and possibly a domain name.


Examples of Web Server Programs:
 Microsoft Internet Information Services (IIS)
 Microsoft Personal Web Server (PWS)
 Apache HTTP Server
 Sun Java System Web Server
 Lighttpd

12. Write a note on CGI Scripting?


CGI stands for Common Gateway Interface. It is a standard for interfacing external
programs with an HTTP server. CGI is a part of the HTTP protocol. It is set or rules
resident at web server. It provides path or way for the web page to communicate with
the web server. CGI converts data input and formats the data so that the browser
can display the result.

CGI programs are used to publish and process forms so that readers can submit
comments, order a product, or search for information from a web page.

Important applications of CGI are : Information display, User counting, Web Search Engines,
Indexing the content, CGI e-mail services, etc.

Lesson No. 1 Web Publishing - Web


Server
What is Web Server?

A Web server is a program running on a Computer that uses HTTP (Hypertext Transfer
Protocol) to serve the files that form Web pages to users, in response to their requests,
which are forwarded by their computers' HTTP clients (Web Browsers).

Web server is a computer that hosts websites and web pages i.e. where the web content is
stored.

A web server consists of a physical server, server operating system (OS) and software used
to facilitate HTTP communication like IIS, Apache, etc.

When you type a Web site address into your browser, Web servers are doing the work of
getting you the page you request.

Every Web server has an IP address and possibly a domain name.

Examples of Web Server Programs:

 Microsoft Internet Information Services (IIS)


 Microsoft Personal Web Server (PWS)
 Apache HTTP Server
 Sun Java System Web Server
 Lighttpd
Lesson No. 2 Cyber Law and Ethics –
1. Define the term Moral, Ethics and Law
Moral :
Moral refers to generally accepted standards of right and wrong in a society. In cyber
world, there are also such standards. e.g Do not make use of pirated software CDs,
Do not use computers for wrong and illegal hacking, stealing of passwords etc. A set
of moral Principles which systematically link moral beliefs to each other is called as
moral theory.
Ethics :
The determination of right and wrong, and following the right behaviour, using morals
is called as ethics.
Law :
Law includes any act of parliament or of state legislature, ordinance promulgated by
the President or a Governor, as the case may be; Bills enacted as President’s Act
and includes rules, regulations, bye-laws and order issued there under. Laws are
rules in written format and governed by sovereign authority.

2. Discuss ethics for computer users.


 All computer users have the responsibility to use computer system with an effective,
efficient, ethical and lawful manner.
 Responsibility of computer user towards the profession, organization and society is
discussed by considering following points:
 Computer users should purchase only legitimate license software products.
 Users must install the software upon the terms and conditions stated by the
software company.
 Users should not install more number of copies of the software than authorize
number of license copies available.
 Should not download software illegally from peer-to-peer network, internet auction
or blogs.
 Computer users should not perform unauthorized access.

3. Explain Software Piracy.


Software Piracy is nothing but copyright violation of software created originally by
individual or institution. In includes stealing of codes / programs and other
information illegally and creating the imitated copy by unauthorized means and
utilizing this data either for own benefit or for profit making is violation of copyright
act. Piracy is possible in many forms and few most common are: duplication of
original license copy, distribution and usage of the same.
Types of software piracy include:
 Borrowing and installing a copy of a software application from a person
 Installing more number of copies of the software than authorized number of licenses
copies available.
 Installing and selling unauthorized copies of software while purchasing new
computers.
 Duplicating and selling copyrighted programs. 0 Downloading software illegally from
peer-to-peer network, Internet auction or blogs,
 Unauthorized written CDs / DVDs for music, various software and utilities etc. are
the most commonly observed examples of piracy.

4. Write a note on Unauthorized Access.


Gaining access without user permission is known as Unauthorized Access.
Attempting to get information (like e-mails, bank account, intellectual or any other
personal and confidential information) from unauthorized person is known as
accessing the machine illegally.
Examples of Unauthorized Access are:
 Hacking financial I bank account related information. 0 Stealing organizational I
intellectual information.
 Illegal monitoring of information owned by other users including mails and
messaging.
 Illegal use / break of login and password of other users
 Causing intentional irritation to other users by means of damaging software and
important information etc.
5. What are the ethics that computer professional should follow? List and
explain.
 Computer professional is obligated to perform assigned tasks competently,
according to professional standards.
 These professional standards include technical excellence and concern for the
social effects of computers on operators, users and the public.
 Computer professionals should ensure that their technical knowledge and efforts to
create desired output are getting utilized in the development of society.
 Computer professionals are bound to operate on ethical grounds and with legal
functions.
Key factors and responsibilities of Computer Professional
 Before processing on defined activities, computer professional must ensure
availability of authentic and legal version of purchased software products. User must
avoid usage of pirated copy, thereby respecting legality of the product.
 Privacy is individual’s right Hence Computer professionals should ensure that they
design the product with high security and avoid any attempt of unauthorized access
to specific site / server.
 Confidentiality of the data should be ensured so that it could be accessed by only
intended user.
 Data storage should be ensured at well protected servers.
 All defects must be rectified before launching the product of that version.
 All applicable cyber laws should be taken into consideration while developing or
launching any software product.
6. Write a note on Ethics in Business.
Internet has been proven as boon to individuals as well as various organizations and
business. E-commerce is becoming very popular among businessmen as it is
helping to reach consumers faster than any other means. Every consumer will
expect that business deals should be carried out in the most legal and efficient way
and he should be benefited with service and product obtained through internet.
 Business should have ethical policies and guidance on the proper use of business
computers.
 Business should have authenticity and quality of product.
 Business should have Branding and quality services.
 Business should have proper data security procedures

7. What is code of ethics?


Following are few key points which user should follow as guidelines.
 Honesty : As a part of decent behavior (netiquette), user shall always demonstrate
the truth while using internet.
 Respect : User should respect the privacy of the other users.
 Confidentiality : User should keep confidentiality while using internet and not share
any information to anybody which will be breach and user should not try to get
confidential data of other users.
 Professionalism : User should maintain professional conduct and well-mannered
approach
 Responsibility : User should take ownership and responsibility of own data on
internet and also ensure that it contains authenticity and truth.
 Communication : User should ensure decent and polite communication with others.
 Obeying the law : User should strictly ensure to obey the law and demonstrate
decent internet usage.

8. List Do's and Don’ts for the ethics culture of Computer professionals.
Do’s:
 Use the Internet to help the work required for knowledge base.
 Use the Internet to communicate the messages.
 Respect the privacy of other users on the Internet
 Download legitimate and authentic programs from the Internet.
 Use licensed software on your computer.
Don’ts:
 Don’t try to break into computers of others.
 Don’t try to steal any personal, financial data on Internet.
 Don’t make duplication of any copyrighted material like books, magazines, designs,
programs, etc. without the permission of the author.
 Don’t give any personal information of yours or anyone on Internet.
 Don’t arrange to meet any unauthorized person met on the Internet.
9. Define the term Cyber Law. Why the need of Cyber law arises? Or What is
Cyber Law?
Cyber Law refers to all the legal and regulatory aspects of Internet and the World
Wide Web. Cyber-space is governed by a system of law and regulation called cyber
law.
Need of Cyber Law:
 Today millions of people are using the Internet all over the world.
 Because of global communication, Internet is misused for criminal an activity which
requires regulation.
 Today many disturbing and unethical things are happening in the cyber space called
cyber crimes.
 People with intelligence and having bad intention are misusing the aspect of the
Internet.
 The criminal activities include various crimes like harassment, e-mail, cyber-stalking,
transmission of harmful programs, unauthorized possession of computerized
information, software piracy, etc.
 Hence there is need for cyber law.

10. Explain IT Act in brief.


The Information Technology Act, 2000 (also known as ITA-2000, or the IT Act) is an
Act of the Indian Parliament (No 21 of 2000) notified on 17 October 2000. It is the
primary law in India dealing with cybercrime and electronic commerce. It is based on
the United Nations Model Law on Electronic Commerce 1996 (UNCITRAL Model)
IT Act 2000 is an Act to provide legal recognition for transactions carried out by
means of electronic data interchange and other means of electronic communication
i.e. legal recognitions for transactions carried out by E-commerce.

The original Act contained 94 sections, divided in 13 chapters and 4 schedules. The
laws apply to the whole of India. Persons of other nationalities can also be indicted
under the law, if the crime involves a computer or network located in India.

The Act provides legal framework for electronic governance by giving recognition to
electronic records and digital signatures. It also defines cyber crimes and prescribed
penalties for them.

11. Define the following terms as mentioned in the IT Act 2000.


1. Access: "Access" with its grammatical variations and cognate expressions means
gaining entry into, instructing or communicating with the logical, arithmetical, or
memory function resources of a computer, computer system or computer network.
2. Addressee: "Addressee" means a person who is intended by the originator to
receive the electronic record but does not include any intermediary.
3.Computer: "Computer" means any electronic magnetic, optical or other high-
speed data processing device or system which performs logical, arithmetic, and
memory functions by manipulations of electronic, magnetic or optical impulses, and
includes all input, output, processing, storage, computer software, or communication
facilities which are connected or related to the computer in a computer system or
computer network.
4. Computer network: "Computer network" means the interconnection of one or
more computers through-
(i) the use of satellite, microwave, terrestrial line or other communication media and
(ii) terminals or a complex consisting of two or more interconnected computers
whether or
not the interconnection is continuously maintained.
5. Computer resource: "Computer resource means computer, computer system,
computer network, data and computer database software.
6. Computer System: "Computer system" means a device or collection of devices.
including output support devices and excluding calculators which are nut
programmable and of being used in conjunction with external files, which contain
computer programs, instructions, input data and output data, that performs logic,
arithmetic, data storage
and retrieval communication control and other functions.
6. Data: "Data" means a representation of information, knowledge, facts, concepts or
which are being prepared or have been prepared in a form, deletion, storage and
retrieval and communication or telecommunication from or within a computer.
7. Information: "Information" includes data, text, images, sound, voice, codes,
computer programs, software and databases or micro film or computer generated
micro fiche:
8. Electronic Gazette: The official gazette published in electronic form is called
Electronic Gazette.
10. Key pair: "Key pair", in an asymmetric crypto system, means a private key and
its mathematically related that the public key, can verify a digital signature created by
the private key.
11. License: "License" means a license granted to a Certifying Authority under
section 24
12. Private key: "Private key" means the key of a key pair used to create a digital
signature.
13. Public key: “Public key" means the key of a key pair used to verify a digital
signature and listed in the Digital Signature Certificate.
14. Electronic form: Means any information generated, sent, received or stored in
media magnetic, optical computer memory, micro film, computer generated micro
fiche or similar device.

12. What is Digital Signature? Where is it used?


 It is a mathematical technique used to validate the authenticity and integrity of a
message, software or digital document on Internet
 The digital equivalent of a handwritten signature or stamped seal, but offering far
more inherent security.
 A digital signature is intended to solve the problem of tampering and impersonation
in digital communications.
 It is unique to the subscriber who affixing it so it is used to identifying such
subscriber.
 It is linked to the electronic record to which it relates in such a manner that if the
electronic record was altered, the digital signature would be invalidated.
 Digital signature use encryption tool to send the message that is unreadable, until
expected recipient uses their private key to decrypt the message.
 The purpose of digital signature is to provide authenticity to user for Information.
 It is a safeguard for information or data.
 Digital signatures secure your data by encoding it.
 Digital signatures can provide the added assurances of evidence to origin, identity
and status of an electronic document, transaction or message, as well as
acknowledging informed consent by the signer.
 Digital signatures have the same legal significance as the more traditional forms of
signed documents

13. Explain Ten Commandments of computing?


1. Thou shalt not use a computer to harm ether people
2. Thou shalt not interfere with other people's computer work
3 Thou shalt not snoop around the other people's computer files.
4. Thou shalt not use a computer for the purpose of steal
5. Thou shalt not use a computer to bear a false witness.
6. Thou shalt not copy or use the software for which Thou has not paid.
7. Thou shalt not use other people's computer resources without authorization or
proper compensation.
8. Thou shalt not copy or use or other people's intellectual output
9. Thou shalt think about social consequence of the program on is writing or the
system one is designing.
10. Thou shalt always use a computer by means that show due considerations and
due respect for one’s fellow humans.

14. What is Security, Privacy and Control?


Security
Security is organizational concerns: business needs safeguards that protect
computer systems and data from damage or unlawful use.
Computer security includes policies, procedures, tools and techniques designed to
protect a computer assets from accidental, intentional or natural disasters, including
theft, breaking physical damage, and illegal access or manipulation.
There are security procedures like passwords, encryption, firewalls, digital
signatures, antivirus, SSL (Secure Socket Layers) to protect information.
Privacy
Privacy is the right of a person. It is concerned with the publication of true account of
private life of individual, medical confidentiality, privacy in electronic communication,
etc. People need assurance that their personal information, such as employment,
financial data, credit history, etc., will be used properly.
Control
Controls are policies, procedure, tools and techniques designed to prevent errors in
data, software and systems. Access privileges, input authorization, data validation,
documentation, fire alarms, training, effective communication are certain controls.

15. Explain Intellectual Property Rights.


Intellectual Property is any creations of human mind like inventions, music, lyrics,
designs, applications, artistic and literary works, etc.
IPR refers to a number of distinct types of creations of the mind for which a set of
exclusive rights are recognized and corresponding fields of law. Under Intellectual
Property Law, owners are granted certain exclusive rights to their Intellectual
property. Common types of IPR incudes copyrights, Fairuse, trademarks, patents,
industrial design rights, trade secrets, Copying and distribution limitations, attribution
and acknowledgement, etc.

16. Explain Copyright.


Copyright is an intellectual property right attached to original works in which the
right exists with originator or creator. Copyright is a form of protection provided by
the law to the authors of "original works of authorship".

Copyright law is useful for authorship determination, duration of protection and


requirement for transfer of right to others. The copyright act can be applied to original
literary work including computer programs, databases, dramatic work, musical work,
Artistic work and Cinematograph of films.

Copyright is the exclusive right to do or authorize the others to do the acts like
perform the work in public, make any movie film or sound recording, make any
translation of the work, to reproduce the work, etc..
It is illegal for anyone to violate any of the rights provided by the Act to the owner of
copyright.

If you develop any work originally, then you can place the copyright symbol ©next to
your name, work.

17. What is fairuse? Write any 2 advantages.


Fair Use is the exceptional case of copyright which allows copying of a limited
amount of materials in certain cases without permission of the copyright owner.

The fair use of a copyrighted work for purposes such as criticism, comment, news
reporting, teaching, scholarship or research.
Even for this uses, whether a specific use is fair or not depends on number of factors
like, the purpose of the use, nature of the copyrighted work, amount of used work,
effect of the use upon the potential market for the value of the copyrighted work.
Advantages of Fair use:
Public would be able to access any copyrighted material without paying any fees or
asking permission.
If partial work is to implemented, then fair use is the better choice.

18. Differentiate/Explain between Shareware, Freeware and Public Domain


Software.
Shareware:
 Shareware programs can be freely distributed and freely tested.
 This program can be shared with other user with owner's permission.
 A trail period generally 30 days) is given to test those programs. After this trial
period, the user who wants to keep using the program has to register or pay a fee.
 The software which are made available with magazines are normally of this type.
Freeware
 Freeware is termed as free software that allow everyone to copy, redistribute and
modify it with free of cost.
 Its copyright is with the authors.
 Freeware is programming that is offered at no cost.
 Linux is an example of freeware.
Public Domain Software
 Public Domain Software is software that is not copyrighted. It implies that the
authors have waived copyright over the software.
 Anybody can copy them, modify them or use them in any manner they want.
 Public Domain programs can be freely incorporated into new works without royalties
for the original material.

19. Write a note on Firewall.


 Firewall is the barrier between two networks used to control and monitor all traffic
between external network and local network.
 It allows full access to insiders for services of the external world, while it grants
access to the external network based on log-on name, password, ITP address, etc.
 It examines the incoming and outgoing packets as per the set rules.

20. What is meant by Encryption?


 Encryption is the conversion of data into coded format so that it cannot be read by
unauthorized third party users.
 The data is converted into the code by the sender and then decoded by the
receiver.
 Only sender and receiver know the rules for encoding and decoding.
 The encryption process consists of an algorithm and a key. Key controls the
algorithm.
 Only the sender and receiver of the message know the key.
 Original message refereed to as plain text, it is converted into random text called
cipher text.
 It is transmitted to the receiving end and at this end the cipher text can be
transformed back to the original plain text b using a decryption algorithm.
What is Commerce
 Commerce is a division of trade or production which deals with the
exchange of goods and services from producer to final consumer
 It comprises the trading of something of economic value such as
goods, services, information, or money between two or more entities.
Q. What is E-Commerce?
What is E-Commerce
 Commonly known as Electronic Marketing.
 “It consist of buying and selling goods and services over an
electronic systems Such as the internet and other computer networks.”
 “E-commerce is the purchasing, selling and exchanging goods and
services over computer networks (internet) through which transaction or
terms of sale are performed Electronically.
E-Commerce includes:
 Electronic trading of physical goods and of intangibles such as
information.
 All the steps involved in trade, such as on-line marketing, ordering.
Payment and support for delivery
 The electronic provision of services such as after sales support or
on-line legal advice.
 Electronic support for collaboration between companies such as
collaborative on-line design and engineering or virtual business
consultancy teams

E-Commerce
 E-Commerce is more than just buying and selling products online.
 Instead, it encompasses the entire online processes of developing,
marketing, selling, delivering, and paying for products and services
purchased on internet.
E-Commerce definition (textbook)
 Electronic Commerce (e-Commerce) is a general concept covering
any form or information exchange executed using information and
communication technologies.
 E-Commerce takes place between companies, between
companies and their customers, or between companies and public
administrations. Electronic Commerce includes electronic trading of
goods, services and electronic material.

Why Use E-Commerce


 Low Entry Cost
 Reduces Transaction Costs
 Access to the global market
 Secure market share
Q. Give the Classification of E-Commerce?
Classification of E-Commerce
It is based on:
 Who orders, the goods and services to be sold.
 Who sold those goods and services and the nature of transactions.
Based on above two criteria, e-commerce can be further classified
as:
a. Business-to-Business (B2B) model
b. Business-to-Consumer (B2C) model
c. Consumer-to-Business (C2B) model
d. Consumer-to-Consumer (C2C) model

Q. Explain the types of E-Commerce? Write a note on B2B, C2B,


C2C, B2C
Business-to-business (B2B)
 B2B stands for Business to Business.
 This model describes commerce transactions between businesses,
such as between a manufacturer and a wholesaler, or between a
wholesaler and a retailer.
 It consists of largest form of E-commerce.
 This model defines that Buyer and seller are both business entities.
 It is commonly known as EDI (Electronic Data Interchange).
 The two businesses pass information electronically to each other
 E.g.:-Dell deals computers and other associated accessories online but
it is does not make up all those products. So, in govern to deal those
products, first step is to purchases them from unlike businesses i.e. the
producers of those products.

Business-to-consumer (B2C):
 It is the model taking businesses and consumers interaction. The basic
concept of this model is to sell the product online to the consumers.
 B2c is the direct trade between the company and consumers. It provides
direct selling through online. For example: if you want to sell goods and
services to customer so that anybody can purchase any products
directly from supplier’s website.
 Business sells to the public typically through catalogs utilizing shopping
cart software. (i.e. typical online buying)
 Customer identifies a need. Searches for the product or services to
satisfy the need.
 Selects a vendor and negotiates a price.
 Receives the product or services (delivery logistics, inspection and
acceptance) makes payment. Gets service and warranty claims.
 Example websites like Amazon.com. Flipkart, etc.

Consumer to Business (C2B)


 In this model, the customer requests a specific service from the
business.
 Consumer to Business is a growing arena where the consumer
requests a specific service from the business.
 It enables buyers to name their own price, often binding, for a
specific good or services generating demand.
 A consumer posts his project with a set budget online and within
outs; companies review the customers requirements and bids out the
project
 Examples: online trading, tenders freelancing with website like
Bazee.com.

Consumer-to-consumer (C2C)
 It facilitates the online transaction of goods or services between
two people.
 Consumer-to-consumer (C2C) (or citizen-to-citizen) model involves
the electronically facilitated transactions between consumers through
some third party.
 A common example is the online auction, in which a consumer
posts an item for sale and other consumers bid to purchase it.
 The sites are only intermediaries, just there to match consumers
Example: OLX, eBay.

Q. List the advantages and disadvantages of E-Commerce


PROS AND CONS OF E-COMMERCE
PROS
 No checkout queues
 Easy access 24 hours a day
 Better Deals for Customers
 Global Reach: You can shop anywhere in the world
 Wide selection to cater for all consumers
 Lower operating costs for business
CONS
 Unable to examine products personally
 There is the possibility of credit card number theft
 Authenticity and Security
 Consumers have to wait for Delivery
 Not everyone is connected to the Internet
 For business - Competitive price

Scope of E-Commerce
E-Commerce uses three technologies:

 Electronic Markets
 Electronic Data Interchange (EDI)
 Internet Commerce:
Q. Write a note on Electronic Market.
Electronic Market
 An electronic market is an information system (virtual market) that
provides facilities for buyers and sellers to exchange information about
price and product offerings.
 Electronic market also tends to be available only to the
intermediaries.
 Electronic Market brings together product, price and service
information from many suppliers
 Electronic Market can thus act as database or catalogue.
Electronic market is the virtual representation of physical market.
 Electronic markets are used for passenger ticket reservations, an
airline booking system and in various financial and commodity markets.
 These markets give the customer (or the customer's intermediary)
easy access to comparative data on price, and other attributes, of the
goods or services on offer.
 Access to this information is advantageous for the consumer but
making the information available is not necessarily beneficial to the
supplier.
 Usage of Electronic Markets

Application has been limited to specific sectors


 Airline Booking Systems
 Financial and Commodity Markets
 Study of Share and stock market
Q. Explain the advantages and disadvantages of Electronic Market.
Advantages of Electronic Market
 Customer Advantage: Easy access to comparative price/service
information. These markets give the customer (or the customer's
intermediary) easy access to comparative data on price, and other
attributes, of the goods or services on offer.
 Supplier: For supplier it facilitates easy access to market
 Lower Search cost: An effective E.-Market increases the
efficiency of market. it reduces the search cost for buyers.
 Assistance to buyers: E-Market is most effective in assisting the
buyers
 Awareness of market: The use of information and communication
technologies to provide geographically dispersed traders with the
information necessary for the fair operation of the market.
 Best negotiations: Easy access to information on a range of
competing product offerings reduces the search cost of finding the
supplier that best meets the purchase requirement.
Disadvantages of Electronic Market
 It becomes difficult for sellers to maintain high price levels, because due
to the introduction of an electronic market search cost is reduced for the
buyer.
 And also second disadvantage for seller is buyer can make easy price
comparison

Q. Explain the term EDI


EDI stands for Electronic Data Interchange.
IT is the exhange of documents in standardized electronic form between
organization in an automated manner directly from a computer
application of one organization to the application in another organization.
EDI is used to electronically transmit documetns, such as purchase
orders, invoices, inquiries, planning receiving advices and other
standard business correspondence between trading partners.
EDI can also be used to transmit financial information and payments to
electronic form.

Q. What are the advantages of EDI? Give the benefits of EDI.


a. Shortened Delay : EDI orders are sent straight into network and the
only delay is the supplier retrieves messages from the system.
b. Reduction in cost: The cost on stationary and postage also on
supporting staff is saved.
c. Reduction in errors: Since data is not repeatedly keyed, the chances
of errors are reduced.
d. Fast Response : With EDI, customers can get fast response regarding
delivery or supply difficulty.
e. EDI payment : EDI payment electronically matched against the
relevant invoices.
f. Accurate Invoicing : With EDI, invoices can be sent electronically and
can be automatically matched with orders and cleared for payment.
g. Business opportunities : Number of customers get increased with EDI

Q. Explain Firewall.
Firewall is the most commonly accepted network protection.
Firewall is barrier between two networks used to control and monitor all
traffic between external network and local network.
It allows full access to insiders for services of the external world, while it
grants access to the external network based on log-on name, password,
IP address, etc..
Firewall is a system containing a router, a personal computer and a host.
It examines incoming and outgoing packets as per the set rules.

Q. Explain Encryption.
Encryption is the conversion of data into a coded format so that it cannot
be read by unauthorized third party users.
The data is converted into the code by the sender and then decoded by
the receiver.
Only sender and receiver know the rules for encoding and decoding.
The encryption process consists of an algorithm and a key. Key controls
the algorithm.
Only the sender and receiver of the message know the key.
Original message referred to as plain text is converted into random text
called cipher text.
It is transmitted to the receiving end and at this end the cipher text can
be transformed back to the original plain text by using a decryption
algorithm.
4. Javascript
Lesson No.4 Client Side Scripting
using JavaScript
Lesson Summary
JavaScript
JavaScript is a web scripting language.
It is an object-oriented language.
Initially, It was called live script.
It was created by Brendan Eich at Netscape.
It was first available in the web browser Netscape
Navigator version 2.
It is used along with the HTML pages either in the body
section or head section inside the
<script> </script> tags.
It is used for validations of data.
It is used to create dynamic web pages.
It can capture events (actions done by users) and
execute a code.
JavaScript is case sensitive language.

Types of Scripting Languages


Client side Scripting
IT is executed on client machine by the browser. E.g.
JavaScript, VBScript.
The source code of client side scripts can be viewed and
altered in the browser without any authentication.
Client side scripts are used generally for validation
purpose, they provide event driven interaction.
Client side scripts are executed by the Client Browser.
No network traffic generated.
Server side Scripting
It resides on the Web Server and executed on the Web
Server.
It is activated by Client.
E.g. ASP, PHP, Perl, JSP, CGI
The server side scripts are protected by login
authentication.
Server side scripts are used for collecting the data when
it is submitted by the Client browser.
Client side scripts require Web Server Software to
execute.
Network traffic is generated with Server-side scripting.

Attributes used in <script> tag.


src - To specify the URL of an external file containing
the JavaScript source code.

language - indicates the language used in the script.

E.g. <script language="JavaScript">

E.g. <script src="scripts/validate.js">

Abbreviations
ASP - Active Server Pages
API - Appliction Programing Interface
JDBC - Java Database Connectivity
DOM - Document Object Model
BOM - Browser Object Model
W3C - World Wide Web Consortium
NaN - Not a Number
Variables
JavaScript variables are containers for storing data
values.
var keyword is used to declare variables.
All JavaScript variables must be identified with unique
names.
The general rules for constructing names for variables
(unique identifiers) are:
 Names can contain letters, digits, underscores, and
dollar signs.
 Names must begin with a letter
 Names can also begin with $ and _
 Names are case sensitive (y and Y are different
variables)
 Reserved words (like JavaScript keywords) cannot
be used as names
JavaScript variable names are case-sensitive.
Local variable - variable declared within procedure
or function.

Data types in JavaScript


JavaScript provides different data types to hold different
types of values. There are two types of data types in
JavaScript.
 Primitive data type
 Non-primitive (reference) data type

Primitive Data Types in JavaScript


There are five types of primitive data types in
JavaScript. They are as follows:

Data Type Description


String represents sequence of characters e.g. "hello"
Number represents numeric values e.g. 100
Boolean represents boolean value either false or true
Undefined represents undefined value
Null represents null i.e. no value at all

Operators
JavaScript operators are symbols that are used to perform operations on operands.
There are following types of operators in JavaScript.
Arithmetic Operators
- + / *
%(Modulus) - To find remainder of division of two numbers
++(increment)
--(decrement)
Comparison (Relational) Operators
== Is equal to
=== Identical (equal and of same type)
!= Not equal to
!== Not Identical
> Greater than
>= Greater than or equal to
< Less than
<= Less than or equal to

Bitwise Operators
& Bitwise AND
| Bitwise OR
^ Bitwise XOR
~ Bitwise NOT
<< Bitwise Left Shift
>> Bitwise Right Shift
>>> Bitwise Right Shift with Zero
Logical Operators
&& Logical AND
|| Logical OR
! Logical Not
Assignment Operators
= Assign
+= Add and assign
-= Subtract and assign
*= Multiply and assign
/= Divide and assign
%= Modulus and assign
Special Operators
(?:) Conditional Operator returns value based on the condition. It is like if-else.
, Comma Operator allows multiple expressions to be evaluated as single statement.
delete Delete Operator deletes a property from the object.
in In Operator checks if object has the given property
instanceof checks if the object is an instance of given type
new creates an instance (object)
typeof checks the type of object.
void it discards the expression's return value.
yield checks what is returned in a generator by the generator's iterator.

Comments in JavaScript
// - single line comments
/* */ - multiple line comments

Functions
A JavaScript function is a block of code designed to
perform a particular task.
A JavaScript function is executed when "something"
invokes it (calls it).
It is a block of JavaScript code that performs a specific
task and returns a value.
A function id defined by using keyword "function".
E.g.
<script>
function msg() {
alert("hello! this is message");
}
</script>
<input type="button" onclick="msg()" value="call functio
n"/>

Objects in JavaScript

In JavaScript, almost "everything" is an object.


An object is a software bundle of variables and related
methods. You can represent real-worldobjects using
software objects.
In JavaScript, An object is a collection of properties,
and a property is an association between a name (or
key) and a value.
A property's value can be a function, in which case the
property is known as a method.
The new keyword is used for creating objects in
JavaScript.

Objects, methods and properties are the basic


building blocks of Object oriented programming
language.

The object binds data and functions(methods) together


which works on data. Functions are called as methods.
Once Object is defined and it can be used as a template
to create many objects of same type.
JavaScript has predefined objects and it supports user
defined objects also.
Core JavaScript contains a set of objects:
 Number
 Date
 Math
 Array
 String
 Boolean
and language constructs such as operators, control
structures, statements, etc.
Select object is the parent of option object.

In Client Side JavaScript, the Core JavaScript is


extended by adding objects to control a Browser
Object model and Document Object Model
DOM and BOM standards are developed by W3C
(World Wide Web Consortium)

DOM (Document Object Model )


DOM is a platform or interface that will allow programs
and scripts to dynamically access and update the
content, structure and style of documents.

Browser Object Model provides objects supported by


Browsers. It allows JavaScript to "talk to" the browser.
 Window Object
 Location Object
 History Object
 Document Object
 Navigator Object
 Screen Object

DOM (Document Object Model)


The DOM is a standard object model
and programming interface for HTML. It defines:
 The HTML elements as objects
 The properties of all HTML elements
 The methods to access all HTML elements
 The events for all HTML elements
In other words: The HTML DOM is a standard for how
to get, change, add, or delete HTML elements.

Window Object
Window object is a top level client side object for each
window or frame.
Properties:
Property Description
Returns the Location object for the
location
window
Returns the Document object for the
document
window
name Sets or returns the name of a window
Sets the text in the status bar of browser
status
window
Returns a Boolean value indicating
closed
whether a window has been closed or not

Methods:
Method Name Description
converts the string passed into
parseInt( )
number/integers.
Displays an alert box with a message and
alert( )
an OK button
blur( ) Removes focus from the current window.
open( ) Opens a new Browser windwow.
close( ) Closes the current window
Displays a dialog box with a message and
confirm( )
an OK & a Cancel button
focus( ) Sets the focus to the current window
print( ) Prints the content of the current window
Displays a dialog box that prompts the
prompt( )
visitor for input.
Calls a function or evaluates an
setTimeout( ) expression after a specified number of
milliseconds.
Calls a function or evaluates an
setInterval( )
expression at specified intervals.
clearInterval( ) clears a timer set with setInterval( ).
clearTimeout( ) clears a timer set with setTimeout( ).

parseFloat( ) converts the string passed into numbers


with decimals (floating point numbers).

Navigator Object
The navigator object is used for browser detection and
can return useful infromation about the visitor's browser
and system. It can be used to get browser information
such as appName, appCodeName, userAgent etc.
Properties:
Property Description
Returns the code name of the Client's
appCodeName
browser
appName Returns the name of the Client's browser
Returns the version information of the
appVersion Client's browser
userAgent property returns the user-
useragent agent header sent by the browser to the
server

Document Object
Document object is created when HTML document is
loaded into the browser.
Properties:
Property Description
specifies the title of the document on the
title
Browser's title bar.
bgcolor Gives background color to the document.
URL Specifies URL of the docuemtn.

fgcolor Specifies the text color

Methods:
Method
Description
Name
write( ) Helps to display string into document windwow.
writeln( ) Displays string into docuement on new line

Events:
Event can be something the browser does, or something
a user does.
JavaScript's interaction with HTML is handled
through events that occur when the user or the browser
manipulates a page.
When the page loads, it is called an event.
When the user clicks a button, that click too is an event.
Other examples include events like pressing any key,
closing a window, resizing a window, etc.
Events are the signals generated when specific
action occurs.
Events List
click
dblclick
mouseover
mouseout
blur
focus
abort
load
unload
reset
select
keypress
keydown
keyup

Event Handler
An event handler typically is a software routine that
processes events - actions such as keystrokes and
mouse movements.
Event handlers are triggered in the browser by user
actions.
Frame/Object Events
onload - The event occurs when an object is loaded.
When a page is loaded into the Web Browser.
onunload - event occurs once a page has unloaded
(user leaves)
onerror - The event occurs when an error happens
during loading of a docuement or image.
onabort - event occurs when an image is stopped from
loading before completely loaded.
onblur - event occurs when the focus is removed from
an form element or window.
onfocus - event occurs when an element gets focus.
onselect - event occurs when user selects some text.
onchange - The event occurs when the value of form
field is changed by the user.
onsubmit - The event occurs when a form is submitted.
onreset - event occurs when a form is reset.
Mouse Events
onclick - event occurs when user clicks in the
document or on a link or form element.
(is the only event handler for radio button)
ondblclick - event occurs when the user clicks in the
document twice .
onmouseover - The event occurs when the user moves
the pointer over an object.
onmouseout - The event occurs when the user moves
the pointer off a clickable area.
onmousedown - event occurs when the user presses a
mouse button over an element.
onmouseup - event occurs when the user releases a
mouse button over an element.
Keyboard Events
onkeydown - event occurs when the user is pressing a
key.
onkeypress - event occurs when the user presses a
key.
onkeyup - event occurs when the user releases a key.

Important Functions
confirm( ) - Displays a dialog box with an OK and
cancel button.
prompt( ) - Displays a dialog box that prompts the
visitor to input.(accepts data from user)
alert( ) - Displays an alert box with a message and OK
button.
eval( ) - used for evaluating a strin representing
arithmetic expression.
indexOf( ) - used to search for the specified character in
a string. Returns the index vlaue of the first occurence.
Find a certain string is present within a given string.
lastindexOf( ) - used to search for the specified
character in a string. Returns the index vlaue of the last
occurence.
substring( ) - used to extract a subset or certain portion
of string.
parseInt( ) - used to convert string
into number/integer.
parseFloat( ) - used to convert string into floating point
number.
getDay( ) - method of the Date object returns the
weekday in number.
getMonth( ) - method of the Date object returns the
month in number.
getYear( ) - method of the Date object returns year part
from the date.
charAt( ) - method of String returns the character at the
specified index value.
toLowerCase( ) - method of String object returns string
into lowercase.
cInt( ) -converts character to number

Methods of form elements


click( ) - method of checkbox object emulates the action
of clicking the checkbox.
blur( ) - method of button object emulates the action of
removing focus on a button.
select( ) - method of password, textbox, textarea object
selects the text in the field.
focus( ) - method of radio object gives focus to the radio
button.
reset( ) - method of the form object resets the form.
Form Objects Methods
Name Description
reset( ) Simulates a mouse click on a reset button for the calling form.
submit( ) Submits a form.

Button Objects Property


Name Description
form Refers to the associated form.
name Indicate the name attribute.
type Indicate the type attribute.
value Indicate the value attribute.

Button Objects Methods


Name Description
blur( ) Focus lost from the button.
click( ) Indicate a mouse click on the button.
focus( ) To get focus to the button.

Password Object Property


Name Description
defaultValue Specifies the value attribute.
form Reflects the form containing the password object.
name Specifies the name attribute.
type Specifies the type attribute.
Specifies the current value of the password object's
value
field.

Password Object Methods


Name Description
blur( ) Removes focus from the object.
focus( ) Gives focus to the object.
select( ) Selects the text

Checkbox Object Property


Name Description
checked Indicate the current state of the checkbox.
defaultChecked Indicate the checked attribute.
form Form containing the checkbox object.
name Indicate the name attribute.
type Indicate the type attribute.
value Indicate the value attribute.

Checkbox Object Methods


Name Description
blur( ) Lost focus from the checkbox.
click( ) Indicates a mouse click on the checkbox.
focus( ) Set focus to the checkbox.

Radio Object Property


Name Description
Selects a radio button programmatically (property of the individual
checked
button).
defaultChecked Specifies the checked attribute (property of the individual button).
Reflects the form containing the radio object (property of the array of
form
buttons).
name Reflects the name attribute (property of the array of buttons).
type Reflects the type attribute (property of the array of buttons).

value Reflects the value attribute (property of the array of buttons).

Radio Object Methods


Name Description
blur( ) Removes focus from the radio button.
click( ) Simulates a mouse-click on the radio button.
focus( ) Gives focus to the radio button.

Textarea Object Property


Name Description
defaultValue Represents the value attribute.
form Represents the form containing the Textarea object.
name Represents the name attribute.
type Represents that an object is a Textarea object.
value Represents the current value of the Textarea object.
Textarea Object Methods
Name Description
blur( ) Removes focus from the object.
focus( ) Gives focus to the object.
select( ) Selects the input area of the object.

Short Questions
1. What is JavaScript?
2. Explain Client-side Scripting.
3. Explain Server-side Scripting.
4. Give the difference between Client-side and server side scripts.
5. What is Document Object? List any 5 properties of doucment object
6. Explain any four built-in fucntions in JavaScript.
7. How to write function in JavaScript?

Write Program Questions


1.Write JavaScript code to print subtraction of 2 numbers.
2.Write JavaScript code to print addition of 2 numbers.
3.Write JavaScript code to print multiplication of 2 numbers.
4.Write JavaScript code to print division of 2 numbers.
5.Write JavaScript code to print addition, subtraction, multiplication & division of 2 numbers.
6.Write JavaScript code to display area, accept value from user.
7.Write JavaScript code to print area of triangle.
8.Write JavaScript code to calculate the average of three numbers.
9.Write JavaScript code to print perimeter of rectangle.
10.Write JavaScript code to print perimeter of trapezium.
11.Write JavaScript code to check whether the number is odd or even.
12.Write JavaScript code to print multiplication table of 3.
13.Write JavaScript code to print numbers from 1 to 10.
14.Write JavaScript code to print sum of 50 natural numbers.
15.Write JavaScript code to print all even numbers from 10 to 50.
16.Write JavaScript code when user click on button, it will display sum of even numbers from 1 to 10.
17.Write JavaScript code to print all odd numbers from 50 to 100.
18.Write JavaScript code to print factorial of 7 on button click.
19.Write JavaScript code to print square of a accepted number.
20.Write JavaScript code to count length of accepted string after click on the button.
21.Write JavaScript code to accept two dates and find the difference in those dates.
22.Write JavaScript code to take a input of string and reverse the string in output.
Write JavaScript code to input 3 digit number and find sum and product of its digit of the number use onblur event for the progr
23.

24.Write JavaScript code to print factorial of accepted number.


Lesson No. 5 ASP.NET (Using Visual Basic.NET)-
Lesson Summary

Web Application
Web Application is an application that uses a web browser as a client.

In a Client-Server environment –

Client is used to run the application and accepts information.

Server application is used to store, retrieve and process the information.

Web applications uses combination of sever-side script languages and client-side


script languages to develop the application

Examples

 Online Word Processor


 Online Image Processing applications
 Web base email clients like Gmail, Yahoo, MSN, etc..
 Google Apps, Microsoft Office Live, WebEx, Web Office, etc.

.NET FRAMEWORK
It is a software technology that is accessible with latest Microsoft Windows Operating
System.
It is Microsoft's Managed Code programming model for building applications on
Windows Clients, Servers and mobile or embedded devices.
For Windows 2003 and above the .NET Framework is installed automatically as a
part of the operating system.
.NET Framework is a platform that provides tools and technologies needed to build
Networked Applications, Distributed Web Services and Web Applications.
.NET Framework is based on object oriented programming environment.
It is the technology for building dynamic Web applications.
It is an important Windows component that supports developing and executing the
next generation of applications and XML Web services.

CLS (Common Language Specifications)


Common Language Specification (CLS) is a set of basic language features that .Net
Languages needed to develop Applications and Services, which are supported by
the CLR.
The main two components of .Net Framework are Common Language Runtime
(CLR) and.Net Framework Class Library (FCL).
CLR (Common Language Run-time)

The Common Language Runtime (CLR) is a run-time Execution Environment which


runs the code and provides services that make the development process faster.

The main function of Common Language Runtime (CLR) is to convert the Managed
Code into native code and then execute the Program.
It works as a layer between Operating Systems and the applications written in .NET
languages that confirms to the CLS.
The runtime automatically handles object layout and manages objects and replaces
them when they are no longer being used.

FCL (.NET Framework Class Library)

It is a large collection of predefined classes, interfaces, and value types that


expedite and optimize the development process and provide access to system
functionality.

Namespaces
Namespaces allows organizing classes, so that they can be easily accessed in other
applications.
Namespaces are the names which do not represent location.
It enable to avoid any naming conflicts between classes that have the same name.

E.g. System.IO, Microsoft.Win32, System, Sytem.Web,


System.Web.UI.WebControls

Assembly
An assembly is a collection of types and resources that forms a logical unit of
functionality.
Assembly is stored as an .exe or .dll file.

ASP.NET
It is a technology for building powerful, dynamic web aplications.

It is an extension version of Active Server Pages(ASP)

ASP.NET is a pre-compiled.

ASP.Net is designed to work with the HTTP protocol. This is the standard protocol
used across all web applications.

ASP.Net applications can also be written in a variety of .Net languages. These


include C#, VB.Net and J#.
.NET Programming Languages
Languages provided by Microsoft
Visual Basic.NET, C#, Visual C++, Visual J#, JScript

ASP.NET Server Technologies


Web Pages (with Razor syntax)
MVC (Model View Controller)
Web Forms (traditional ASP.NET)

ASP.NET Development Tools


WebMatrix
Visual Web Developer
Visual Studio.NET

ASP.NET PAGES
ASP.NET files have the extension .aspx
ASP.NET pages contain directives that allows specifying page properties &
configuration information for the page.
The directives are used by ASP.NET as instructions for how to process the page, but
they are not rendered as part of the markup that is sent to the browser.
Application directives specify optional application-specific settings used by the
ASP.NET parser when processing.

@ Page directive - defines page-specific attributes used by the ASP.NET page


parser and compiler. Can be included only in .aspxfiles.

Attributes of @Page directive: Buffer, ClassName, CodeBehing, Src, Title,


ValidateRequest, etc

View State persists values in a page.

Code-declaration blocks
Language attribute specifies language used in code declaration block.
The runat attribute specifies that the code contained in script block runs on the
server.
The src attribute specifies path and file name of an external script file to load.
<script runat="server" language="VB" src="filepath".
</script>
Visual Studio.NET
The Visual Studio is the tool used for desing, develop, debug and develop Web
applications and traditional client applications.

Every Visual Basic project has a project file with an extension of vbproj.

Parts of Visual Studio window:


Server Explorer
It is tool that is shared across development languages and projects. It is used to
connect server as well as view and and access its resources.

Solution Explorer
It provides an organized view of the projects and their files.

Class View
It displays the symbols defined, referenced or called in the application for
developing. The Class View toolbar allows to add virtual folders and to navigate
within the objects and member panes.

Properties Window
It is used to view and change the design-time properties and events of selected
objects from web form to editors and designers. It is alos used to edit and view
file, project, and solution properties.

Document and Outline View


To view the logical structure of document, to determine which elements are HTML
elements and which ones are Web server controls.
Navigate to specific elements in Desing view and in Source view.

Object Browser
It allows to select and examine the symbols available which are used in the projects.
Code Editor
The Visual Studio.NET Code editor is also known as the Text Editor.

Design View
The Design view displays ASP.NET Web pages, master pages, content pages,
HTML pages and user controls using a near WYSIWYG view.

Source View
The Source view displays the HTML markup for the Web page, which can be edited.

Control Class
The Control Class implements very basic functionality required by classes that
display information to the user. IT handles user input through the keyboard and
pointing devices.Control Class handles message routing and security.

ASP.NET Controls
ASP.NET Web Server Controls
Web Server Controls are objects on ASP.NET web pages that run when the page
is requested and render markup to a browser.

It contains classes that are rendered as HTML tags, such as the TextBox control and
the ListBox control.
The WebControl class serves as the base class for many of the classes in
theSystem.Web.UI.WebControls namespace.

Introduction and use of different Controls


Text Box - control displays a textbox for user input.
Label - control displays a text on a web page.
Image - control displays image on a web page.
ImageMap
DropDownList - control allows the user to select a single item from a drop down list.
CheckBox - control displays a checkbox that allows the user to select a true or false
condition.
CheckBoxList - control creates multi selection check box group.
RadioButton - control displays radio button.
HyperLink - control displays a link to another web page.
HiddenField - represents a hidden field used to store a non-displayed value.

HTML Server Controls


The System.Web.UI.WebControls namespace contains classes that allow you to
create HTML server controls on a Web Forms page. HTML Server controls run on
the server and map directly to standard HTML tags supported by most browsers.
HtmlAnchor - control used to programatically control an <a> html element.
HtmlButton - control used to programatically control as the html <button> element.
HtmlForm - control used as same the HTML <form> element.
HtmlImage - control used as HTML <img> element.
HtmlInputButton - control used as HTML <input type=button> element.
HtmlInputCheckBox - control used as HTML <input type-checkbox> element.
HtmlInputFile - control used as HTML <input type=file> element.
HtmlInputHidden - control used as HTML <input type=hidden> element.
HtmlInputRadioButton - control used as HTML <input type=radio> element.
HtmlInputText - control to run server code against the <input type=text> and <input
type=password> HTML elements.
HtmlSelect - control is same as the HTML <select> element.
HtmlTextArea - control is same as the HTML <textarea> element. It allow multiline
text box. Cols property determines the width and Rows property determines the
height.

Validation
Validation is the testing process to determine whether value entered by visitor inot
field is valid or not.
Validation Server Controls
ASP.NET provides Validaton Server controls to compare user input in different fields
or against values that might be held in other controls, such as textbox, database etc.
Namespace - System.Web.UI.WebControls
Assembly - System.Web (in System.Web.dll)
CompareValidator - allows for comparisons between the user's input and another
item using a comparison operator(equals, greater than, less than, and so on)

RangeValidator - checks the user's input based upon a lower and upper-level range
of numbers or characters.

Components and Applications


The System.Web namespace supplies classes and interfaces that enable browser-
server communication.
It includes the HttpRequest class which provides extensive information about the
current HTTP request, the HttpResponse class, which manages HTTP output to
the client.

HttpResponse
- manages HTTP output to the client.
Properties:
Buffer
BufferOutput
CHarset
Cookies - gets the response cookie collection, contains new cookies created on the
server and transmitted to the client in the Set-Cookie header.
Expires
Headers
Output

Method :
BinaryWrite - Writes a string of binary characters to the HTTP output stream.
Clear - Clears all content output from the buffer stream.
End - Sends all currently buffered output to the client,
Flush - Sends all currently buffered output to the client.
Write - Writes a string to an HTTP response output stream.

HttpRequest
HttpRequest enables ASP.NET to read and the HTTP values sent by a client during
a Web request.
The query string and fields on an HTML form that are available from an HTTP
request.

Properties:
Browser - Gets or sets information about the requesting client's browser capabilities.
Cookies - Gets a collection of cookies sent by the client.
- contains cookies transmitted by the client to the server in the Cookie header.

SeverVariables - Gets a collection of Web Server variables.


HTTP_COOKIE - Returns the cookie string that was included with the request.
HTTP_HOST - Returns the name of the Web Sever.
HTTP_METHOD - Returns the method used to make the request.
HTTP_URL - Returns the encoded URL
HTTP_USER_AGENT - Returns a string describing the browser that sent the
request.
HTTP_VERSION - Returns the name and version of request protocol.
REMOTE_ADDR - Retruns the IP Address of the remote host making request.
REMOTE_USER - Returns the name of the host making request.
REQUEST_METHOD - USed to make the request, this can be Get, head, post, and
so on
SERVER_NAME - Returns the Server name.
SERVER_PORT - Returns the Server port number to which the request was sent.

Methods:
ToString - It converts an object to its string representation.
ValidateInput - It sets flags so that when they get accesses for the Cookies, Form,
or Query String. It checks all input data against a hard-coded list of potentially
dangerous data.

Application and State Management


Application state is a data storage area available to all classes in an ASP.NET
application.
stores variables that can be accessed by all users of an ASP.NET application.
Application state is stored in an instance of the HttpApplicationState class.
The HttpApplicationState class is most often accessed through the Application
property of the Http Context class.

By default, ASP.NET session state is enabled for all ASP.NET applications.

Global.asax
The Global.asax file also known as the ASP.NET application file, is an optional file
that contains code for responiding to application-level and session-level events
raised by ASP.NET or by HTTP modules.

The Global.asax file resides in the reoot directory of an ASP.NET application.


The Global.asax file is optional. Yo create it only if you want to handle
Application_Start, Application_Eng, Session_Start and Session_Eng events.

@Application difective can be used only in Global.asax files, while the other
directives are used in other ASP.NET files such as Web pages (.aspx files) and user
controls (.asex files)
Application directives specify optional application-specific settings used by the
ASP.NET parser when processing.

Cookies
A cookie is a small bit of text or small amount of data that is stored either in a text file
on the client files system or in-memory in the client browser session.
The cookie contians information the Web application can read whenever the user
visits the site.
Cookies can be temporary (with specific expiration times and dates) or persistent.
The cookies is used to store information about a particular client, session or
application.

Short Questions:
 Explain the basic principle of ASP.NET
 What is CLR?
 Define CLS
 Define FCL
 Explain Advantages of ASP.NET
 Explain difference in the processing of single-file pages and Code-behind -
Ans. Page No. 113 of text book
 Define Web Server Controls
 Define Html Server Controls
 Define the method flush() and write(string) opf Http response class
 Define the method Clear and End
 Explain Server variables in ASP.NET.
6. DB with ASP.NET
Lesson No. 6 Database Concepts and
Interaction with ASP.NET
Lesson Summary
Important Terms
Data – Collection of facts (unorganized)
Information – Processed data (manipulated data to produce results)
Database – Collection of related information grouped together
RDBMS – Relational Database Management System E.g. Oracle, MySQL, Access, MS SQL
server
MS Access is an RDBMS software.
Database Objects – Table, Query, Form, Report

Table
Table – Grid (collection) of rows and columns, where data is stored.

Record – Rows/Tuple in a database table (collection of fields)


Field – Stores attribute value. Column in a table containing discrete element of information
Primary Key – is a column used to uniquely identify rows in the table. Used for relating a
table to another one. Cannot have duplicate values. Applied to one column in MS
Access.(Not compulsory)
Foreign Key – is a column from another table(primary key column) used to relate tables.
Relationship

One to One – a field in one table is associated with one field of another table and vice versa.
One to Many – a field in one table is associated with more than one fields in another table.
Many to Many – a field in many table is associated with more than one fields in another
table.

MS Access – Data Types for Columns


Text – (default data type) For textual data max 255 characters
Memo – For textual data max 65536 characters
Number – To store numeric data, types – Integer,
Long, Single, Double
Date/Time - To Store Date and Time values.
Currency– Used for Currency. Max 15 digits and 4 decimal places
AutoNumber – To give Auto number starts from 1
Yes/No – To store True/False. Takes 1 bit
OLE Object – To store binary files- audio, video, pictures upto 1 GB
Hyperlink – Contains links to other files
Attachment– For attaching files.
Calculated– To store result of expressions involving other column data
Lookup Wizard– To store list of options, which can be chosen
Views in MS Access
Design View – Used to define table, reports, forms. You can modify structure.
Datasheet View – To view, add, edit, delete table rows.
Tables can be created in Design view and and Datasheet view

MS Access Queries & its Types


Query – Used to get specific information from tables, search a database for a specific
record.
IT is fundamental means of accessing and displaying data from tables.
Used to create, view, change and analyze data tables.
Select Query(default) – To retrieve data from one or more tables.
Parameter Query – Used with other query type. It displays dialogue box prompting for
information
Cross Tab Query – To get summarized information. (count, sum, average and other
aggregate functions and groups records)
Action Query – To make changes to, or move records. DELETE, UPDATE, APPEND and
Make Table queries.
Queries can be created by two ways – Using Wizard, Using Design View

Options used in Query


Criteria option – To apply logical expressions/conditions on a query. It is associated with
fields in the query design indicates how to filter records in query output.
Sort option – To sort the rows ascending or descending

QBE – Query By Example

SQL Structured Query Language


SQL – Language used to access data from database. Add, retrieve, modify, delete
database. Developed by IBM
Types of SQL statements/queries
DDL (Data Definition Language) – Create, Alter objects
DML (Data Manipulation Language) – Select, Insert, Update, Delete
DCL (Data Control Language) – Commit, RollBack
TCL (Transaction Control Language)
A SQL statement/query is made up of SQL clauses.
SELECT – To query a table, to select a table and access data from the database.

SQL clauses
SELECT – To query a table, to select a table and access data from the database.
FROM – specifies the name of table (compulsory clause in Select)
ORDER BY – To sort the table rows in ascending or descending order. Keywords – ASC
and DESC
WHERE – To define criteria for rows to selected for output
GROUP BY – To group records on values of a field
INSERT – To add the records in database

Comparison of SQL and MS-Access


SQL is designed for Multi user computer system, while Access is designed for Single
computer system.
SQL can support as a developer tool while Access cannot support as a developer tool.
In SQL procedures are supported while in Access procedures are not supported.
Locking of data is available in SQL.
SQL provides security for structure

MS Access - Reports
Report – Reports are based on table or query.
IT is used to display records in the prescribed form.
It is a printable presentation of data gathered from a query.
They are used to view, format, print and to summarize data.
The data displayed on report cannot be edited.
Report design has total 3 sections.
Reports can be created from Design view and Report Wizard

MS Access - Form
Form – Forms provide users with an easy-to-read interface where they can enter table data.
It displays data from one or more table.
Data can be inserted, updated, or deleted from a table using a Form object.
Data entry forms are primary means of entering data into tables of the database.

Data access with ASP.NET

Communication can be established between application and an MS Access database by


creating a connection that points to the actual database file (.accdb or .mdb)
Data in MS Access can be connected to ASP.NET / VB.NET by running the Data Source
Configuration Wizard and selecting Database on the Choose a Data Source Type

ODBC provides a uniform access to data stored in different formats and databases.
We communicate with a database through ASP using ActiveX Data Object (ADO)
DSN – Data Source Name Types – File, System, User

ADO.NET
ADO stands for ActiveX Data Objects.
It is a Microsoft Technology.
ADO is a Microsoft Active-X component.
It is a programming interface to access data in a database.
It provides consistent access to data sources such as MS SQL Server, MS Access and other
data sources through OLE DB and XML.
ADO provides an object oriented programming interface for accessing data source such as
SQL Server.

Connected Architecture of ADO.NET


The architecture of ADO.net, in which connection must be opened to access the data
retrieved from database is called as connected architecture.

Abbreviations
ADODB – ActiveX Data Object Database
OLE – Object Linking and Embedding
OLEDB – Object Linking Embedding Database
ODBC – Open Database Connectivity
JDBC - Java Database Connectivity

Disconnected Architecture of ADO.NET


The architecture of ADO.NET in which data retrieve from database can be accessed even
when connection to database was closed is called as disconnected architecture.

Disconnected architecture of ADO.NET was built on classes connection, DataAdapter,


command builder and dataset and dataview.

ADO.NET Objects
ADO Connection Object – used to create an open connection to a data source. Types of
connection depends on what database system you are working. E.g. SqlConnection,
OleDbConnection, OdbcConnection
Connection.Open statement of connection object open the database.
ODBC driver should be installed and a data source name should be provided while using an
ODBC data source.
Data Adapter Object – is a integral part of the ADO.NET which serves as a bridge between
a DataSet and Data Source. The DataAdapter can perform Select, Insert, Update and
Delete, SQL operations in the Data Source.

Command object – executes SQL statements and Stored Procedures against the Data
source in the Connection object.

Property of Command object – CommandText which contains a string value that


represents the command that will be executed in the Data source.

Recordset object – used to hold a subset of the records of a table.


It is filled with records by using the Open method.
Properties – BOF, EOF, state, locktype, maxrecords
Methods – Open, Move, AddNew, Update,

Datareader – Used to retrieve the result set, It reads data from data store in forward only
mode

SQL Statements performed on recordset/table


SELECT – To select data from table/database
INSERT INTO – To insert a new row in a table/recordset
DELETE – To delete rows in a table./delete current record in a recordset.
UPDATE – To update existing record in a table/recordset.

Dataset object – It has a collection of DataTables and DataRelation objects.

The DataTable object contains DataRow and DataColumn Collections.

The DataRelation object stores information about related tables, including which columns
contain the primary keys and foreign keys that link the tables.

Access Data Source Control


This control is designed to work with Microsoft Access.
It uses OleDb data provider internally.
It enables to retrieve data from database file.

Access Data Source Control


Properties of AccessDataSource Control
Sorting – Sets the Data SourceMode property to the DataSet value.
Filtering – Sets the FilterExpression property to a filtering expression, used to filter the data
when the select method is called.
Deleting – Sets the DeleteCommand property to a SQL statement, used to delete data.
Updating – Sets the UpdateCommand property to a SQL statement, used to update data.
Inserting – Sets the InsertCommand property to a SQL statement, used to insert data.

Short Questions
 Define Data and Database
 Explain the types of Relationships that can be created in MS-Access.
 Define the term Record and Field.
 What are data types in Access?
 Explain the concept of Primary key in MS-Access.
 Define the term Table and Queries
 What is Query? Explain used of Query
 Explain various methods of report creation.
 What is SQL? Explain need of SQL.
 Explain the terms ADO, OLEDB, ODBC nand DSN
 Explain the ADO.NET objects: Command, Connecton and Recordset
 Explain SQL Statements.
 Explain AccessDataSource Control and its properties

S-ar putea să vă placă și