0% found this document useful (0 votes)
23 views10 pages

Topics - For - Study - Final of Web Technologies

The document provides an overview of HTML, CSS, JavaScript, XML, and ASP.NET, detailing key elements such as the IMG tag, inline and external CSS, JavaScript objects and statements, XML structure, and ASP.NET controls. It explains the use of comments, hyperlinks, and various JavaScript functionalities including the document object model and conditional statements. Additionally, it covers ASP.NET architecture, access modifiers, and logical operations.

Uploaded by

aniruddh2573
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
23 views10 pages

Topics - For - Study - Final of Web Technologies

The document provides an overview of HTML, CSS, JavaScript, XML, and ASP.NET, detailing key elements such as the IMG tag, inline and external CSS, JavaScript objects and statements, XML structure, and ASP.NET controls. It explains the use of comments, hyperlinks, and various JavaScript functionalities including the document object model and conditional statements. Additionally, it covers ASP.NET architecture, access modifiers, and logical operations.

Uploaded by

aniruddh2573
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 10

HTML

1. IMG tag
Use the <img /> tag to place an image on your web page.
<img src="sunset.gif" />

2. HTML Comment
o A comment is a way for you as the web page developer to control what lines of code are to be
ignored by the web browser.
o Comment syntax may be a little complicated, there is an opening and a closing much like tags.
1. <!-- Opening Comment
2. -- > Closing Comment

<!-- Comments -->


3. HyperLink
Hypertext references can be Internal, Local, or Global.
o Internal - Links to anchors on the current page
o Local - Links to other pages within your domain
o Global - Links to other domains outside of your site
Internal - href="#anchorname"
Local - href="../pics/picturefile.jpg"
Global - href=http://www.xyz.com/

====================================================================================================

CSS
1. Inline CSS
It is possible to place CSS right in your HTML code, and this method of CSS usage is
referred to as inline css.
o Inline CSS has the highest priority out of external, internal, and inline CSS.
o This means that you can override styles that are defined in external or internal by using
inline CSS.
o If you want to add a style inside an HTML element all you have to do is specify the desired
CSS properties with the style HTML attribute.

<p style="background: blue; color: white;">A new background andfont color with inline CSS</p>

2. External CSS
External Style Sheet
o When using CSS it is preferable to keep the CSS separate from your HTML.
o Placing CSS in a separate file allows the web designer to completely differentiate between
content (HTML) and design (CSS).
o External CSS is a file that contains only CSS code and is saved with a ".css" file extension.
o This CSS file is then referenced in your HTML using the <link> instead of <style>.

<link rel="stylesheet" type="text/css" href="test.css" /></head>

3. Background Image in CSS


CSS Background Image
o The background-image property specifies an image to use as the background of an
element.
body {background-image:url('paper.gif');}
4. Margin shorthand property in CSS.
Margin - Shorthand property
o To shorten the code, it is possible to specify all the margin properties in one property. This
is called a shorthand property.
margin:100px 50px;
===========================================================================
JavaScript
1. document object in JavaScript.

• There are lots of objects that descend from the document object forming a large sub-tree
known as the Document Object Model (DOM), which has become standardized.
• The document object represents the HTML displayed in window.
• Using this object it is possible to access information about the document itself and also about
the information content.
• Using this object it is possible to control certain parameters of the current document like
background, foreground and link colors.

Var myObj= new Object();


document.bgColor = “#9F2020”;
documet.fgcolor = “#FAF519”;

2. switch statement in JavaScript


Use the switch statement to select one of many blocks of code to be executed.

switch(n)
{
case 1:
execute code block 1 break;
case 2:
execute code block 2 break;
default:
code to be executed if n is different from case 1 and 2
}

The default Keyword


Use the default keyword to specify what to do if there is no match.

3. Math Object in JavaScript.


• The Math object allows you to perform mathematical tasks.
• The Math object includes several mathematical constants and methods.
• Syntax for using properties/methods of Math:

var x=Math.PI;
var y=Math.sqrt(16);

4. condition statement in JavaScript.


If...else Statement
• Use the if....else statement to execute some code if a condition is true and another
code if the condition is not true.
if (condition)
{
code to be executed if condition is true
}
else
{
code to be executed if condition is not true
}
a. built-in objects in JavaScript.
Built•in Objects:
• JS String
• JS Date
• JS Array
• JS Boolean
• JS Math
• JS RegExp

b. conditional operator in JavaScript.


Conditional Operator
• JavaScript also contains a conditional operator that assigns a value to a variable based
on some condition.
variablename=(condition)?value1:value2 voteable=(age<18)?"Too young":"Old enough";

c. demonstrate direct instance of Object


Creating a Direct Instance
• This example creates a new instance of an object, and adds four properties to it:

person=new Object();
person.firstname="Narendra";
person.lastname="Modi";
person.age=24;
person.eyecolor="blue";

d. JavaScript Operators.
Operator Name
+ Addition
- Subtraction
* Multiplication
/ Division
% Modulus
= Assignment

e. for/in loop to display elements of array containing name of friends.

var friend=new array(“Raju”,”Viju”,”Ramu”);


for ( x in friend )
{
document.write(friend[x]);
}
f. JavaScript code to demonstrate use of Document Object.

• There are lots of objects that descend from the document object forming a large sub-
tree known as the Document Object Model (DOM), which has become standardized.
• The document object represents the HTML displayed in window.
• Using this object it is possible to access information about the document itself and
also about the information content.
• Using this object it is possible to control certain parameters of the current document
like background, foreground and link colors.

VarmyObj= new Object();


document.bgColor = “#9F2020”;
documet.fgcolor = “#FAF519”;

=========================================================================
XML
1. DTD Elements with data
o Elements with data are declared with the data type inside parentheses:
<!ELEMENT element-name (#CDATA)>
or
<!ELEMENT element-name (#PCDATA)>
or
<!ELEMENT element-name (ANY)>
example:
<!ELEMENT note (#PCDATA)>
o #CDATA means the element contains character data that is not supposed to be parsed by a
parser.
o #PCDATA means that the element contains data that IS going to be parsed by a parser.
o The keyword ANY declares an element with any content.
o If a #PCDATA section contains elements, these elements must also be declared.

2. EMPTY element

o Empty elements are declared with the keyword EMPTY inside the parentheses:
<!ELEMENT img (EMPTY)>

3. define element in XML


o An XML element is everything from (including) the element's start tag to (including) the
element's end tag.
o An element can contain:
§ other elements
§ text
§ attributes
§ or a mix of all of the above...
o In above example <title>, <author>, <year> and <price> are elements.

4. XML code to create person/book/vehicle information.


<xml version=”1.0”?>
<bookstore>
<book>
<title>Learning XML</title>
<author>Erik T. Ray</author>
<year>2003</year>
<price>39.95</price>
</book>
</bookstore>

5. DTD Attributes with example.


Attributes provide extra information about elements.
• Attributes are placed inside the start tag of an element.
• Declaring Attributes
o In the DTD, XML element attributes are declared with an ATTLIST declaration. Anattribute
declaration has the following syntax:
<!ATTLIST element-name attribute-name attribute-type default-value>

6. Differentiate between XML and DTD Schema.

XML SCHEMA DTA


Markup Global Element can be root Can specify only the
root
validation No ambiguous content support. element in the instance
document. No ambiguous
content support.
Namespace Yes. Declarations only where No.
support multiple namespaces are used.
Code reuse Can reuse definitions using Poorly supported. Can use
named types. parameter entities.
Data type Provides flexible set of data types. No real data type support.
Validation Provides multi-field key cross
references. No co-occurrence
constraints.

7. XML Schema Element Types with example.


• XML Schemas define the elements of your XML files. It’s of two types:
o Simple
o Complex Type
A simple element is an XML element that can contain only text. It cannot contain any other elements
or attributes.
The syntax for defining a simple element is:
<xs:element name="aaa" type="bbb"/>
<xs:element name="lastname" type="xs:string"/>
<xs:element name="age" type="xs:integer"/>
<xs:element name="dateborn" type="xs:date"/>

A complex element is an XML element that contains other elements and/or attributes.
· There are four kinds of complex elements:
o empty elements
o elements that contain only other elements
o elements that contain only text
o elements that contain both other elements and text

<date lang="norwegian">03.03.99</date>

8. Differentiate between XML and HTML.


============================================================================

ASP
1. HTML Controls

Controls Description
Name

Button It is used to create HTML button.

Reset Button It is used to reset all HTML form elements.

Submit Button It is used to submit form data to the server.

Text Field It is used to create text input.

Text Area It is used to create a text area in the html form.

File It is used to create a input type = "file" component which is used to upload file to the
server.

Password It is a password field which is used to get password from the user.

CheckBox It creates a check box that user can select or clear.

Radio Button A radio field which is used to get user choice.

Table It allows us to present information in a tabular format.

Image It displays an image on an HTML form

ListBox It displays a list of items to the user. You can set the size from two or more to specify
how many items you wish to show.

Dropdown It displays a list of items to the user in a dropdown list.

Horizontal It displays a horizontal line across the HTML page.


Rule
2. List Controls
ASP.NET provides the following controls
• Drop-down list,
• List box,
• Radio button list,
• Check box list,
• Bulleted list.
These control let a user choose from one or more items from the list. List boxes and drop-down
lists contain one or more list items. These lists can be loaded either by code or by the
ListItemCollection editor.
Basic syntax of list box control:
<asp:ListBox ID="ListBox1" runat="server" AutoPostBack="True"
OnSelectedIndexChanged="ListBox1_SelectedIndexChanged">
</asp:ListBox>

3. Web Controls
Following is a list of common web controls :

Label
Panel
Button
TextBox
CheckBox
RadioButton
RadioButtonList
ListBox
DropDownList
Table/TableRow/TableCell
DataGrid
DataList
Repeater
Calender
Validation controls

4. Global.asax.
In ASP.NET it is possible to specify the event-handlers that need to be invoked on the
occurrence of particular events. These event-handlers are defined in a global file by name
Global.asax. The Global.asax file of ASP.NET has a provision for the following event-
handlers
• Application_OnStart
• Application_OnEnd
• Session_OnStart
• Session_OnEnd
• Application_BeginRequest
• Security_OnAuthenticate
a) access modifiers in ASP.NET.
Access Modifiers
All types and type members have an accessibility level. The accessibility level controls
whether they can be used from other code in your assembly or other assemblies. Use the
following access modifiers to specify the accessibility of a type or member when you declare
it:
• Public: The type or member can be accessed by any other code in the same assembly or
another assembly that references it.
• Private: The type or member can be accessed only by code in the same class or struct.
• Protected: The type or member can be accessed only by code in the same class, or in a class
that is derived from that class.
• Internal: The type or member can be accessed by any code in the same assembly, but not
from another assembly.
• Protected internal: The type or member can be accessed by any code in the assembly in
which it's declared, or from within a derived class in another assembly.
• Private protected: The type or member can be accessed only within its declaring
assembly, by code in the same class or in a type that is derived from that class.

b) ASP Application showing message “Hello World”.


c)
<HTML>
<HEAD>
<TITLE>ASP Script</TITLE>
<script language=”C#” runat=”server”> void Page_Load(Object s,EventArgs x) {
Response.Write(“Hello World!”);
}
</script>
</HEAD>
</HTML>

d) any two server-side controls with example.


ASP.NET server controls are the primary controls used in ASP.NET. These controls can be grouped
into the following categories:
• Validation controls - These are used to validate user input and they work by running
client-side script.
• Data source controls - These controls provides data binding to different data sources.
• Data view controls - These are various lists and tables, which can bind to data from
data sources for displaying.
• Personalization controls - These are used for personalization of a page according to
the user preferences, based on user information.
• Login and security controls - These controls provide user authentication.
• Master pages - These controls provide consistent layout and interface throughout the
application.
• Navigation controls - These controls help in navigation. For example, menus, tree
view etc.
• Rich controls - These controls implement special features. For example, AdRotator,
FileUpload, and Calendar control.
The syntax for using server controls is:

<asp:controlType ID ="ControlID" runat="server" Property1=value1 [Property2=value2] />

<asp:Calendar ID="MyCalendar" runat="server" BackColor="Yellow" BorderColor="#001122" /


e) Explain ASP.NET Architecture with Diagram.

As shown, all Web clients communicate with ASP.NET applications through IIS. IIS deciphers the
request, authenticates, and finds the requested resource (such as an ASP.NET application). If
authorized, it returns the appropriate resource to the client. In addition to the built-in ASP.NET
security features, an ASP.NET application can use the Common Language Runtime low-level security
features.

f) logical operations in ASP.NET with example.


Logical operators are used to perform logical operation such as and, or. Logical operators
operate on Boolean expressions (true and false) and returns Boolean values. Logical operators
are used in decision making and loops.

&& Logical and Returns true if both statements are true x < 5 && x < 10
|| Logical or Returns true if one of the statements is true x < 5 || x < 4
! Logical not Reverse the result, returns false if the result is true !(x < 5 && x < 10)

You might also like