Indus University Lab INDEX Web Engineering

Total Page:16

File Type:pdf, Size:1020Kb

Indus University Lab INDEX Web Engineering

Indus University Lab INDEX Web Engineering

Sr. No Date Title Sign

Introduction to Web pages and Technologies 1 09/09/15 (Web Form ,Web pages , MVC) Web Development Getting Started with ASP.NET 2 16/09/15 (Visual studio 2012 , Web matrix)

3 23/09/15 Building Web Pages And Web Sites With HTML 5, CSS. Building Web Pages And Web Sites With JavaScript, And 4 30/09/15 Server Scripting

5 07/10/15 Static Web Pages And Techniques WP References (WP classes , WP Security, WP 6 14/10/15 Database)

7 21/10/15 WP References( WP Web Mail , WP helpers) 8 28/10/15 ASP.NET Razor (introduction, syntax, Variable..)

9 04/11/15 ASP.NET (MVC Intro ,Application ,folder…) 10 11/11/15 MVC (Database ,Controllers.. )

11 18/11/15 Work with Web Form (Intro ,Pages, Control…)

12 25/11/15 Web Form (Event ,Form, View State …)

13 02/12/15 Web Form(Navigation , Hash tab ..) 14 09/12/12 Introduction of MVVM(Model View View Model) Concept Of Building Web, Web Certification, Web 15 15/12/15 Statistics

Marks Distribution

Lab Manual 15 Final lab 20 viva 15

1 Instructor: Muhammad Saddam Khokhar Indus University Lab INDEX Web Engineering

LAB 1

Introduction to world wide web (www)

The world wide web is a set of many thousands of computers that are connected to the internet and serving web pages. These computers are usually controlled by a hosting company but in some cases can also be a personal server or business server that has web server software running.

Web server

A web server is the actual computer that is set up to serve web pages to the world through the internet. This takes a very fast internet connection because of the possibility of hundreds of people using the server and posted web sites at any given time.

Website A website is a group of web pages that have information in the various pages that contain similar subject materials. For instance, the web site would have a name (subject) such as GoodFords.com and have several pages related to good Ford vehicles. The website has a main web page commonly called the Homepage (index.html or default.html). The site's address will display the homepage and you can click on hyperlinks to go to other pages on the website.

Webpage A webpage is a text page written in a form of HTML (hyper text markup language) that contains text, links or tags that will display graphics, audio, video, downloadable files and of course other web pages. A web page is a page containing information on a subject. As in the above example, a page could be on Ford Mustangs, and another page in the same website, pertaining to Ford Web browser A web browser (Microsoft's Internet explorer or Mozilla's Firefox for example) is a program that translates the code that makes up a webpage (HTML) into a form that we can recognize.

Hyper links

2 Instructor: Muhammad Saddam Khokhar Indus University Lab INDEX Web Engineering

A hyper link is usually shown as a blue underlined term on a web page that equates to another web page on the same website or another related website.

ASP.NET 4 is a development framework for building web pages and web sites with HTML, CSS, JavaScript and server scripting. ASP.NET 4 supports three different development models: Web Pages, MVC (Model View Controller), and Web Forms:

Web Pages MVC Web Forms

Single pages (SPA) model MVC model Event driven model

Similar to PHP and classic ASP (Model View Controller) Traditional ASP.NET

What is Web Pages? Web Pages is one of the 3 programming models for creating ASP.NET web sites and web applications. The other two programming models are Web Forms and MVC (Model, View, Controller). Web Pages is the simplest programming model for developing ASP.NET web pages. It provides an easy way to combine HTML, CSS, JavaScript and server code:

 Easy to learn, understand, and use  Built around single web pages  Similar to PHP and Classic ASP  Server scripting with Visual Basic or C#  Full HTML, CSS, and JavaScript control Web Pages is easy extendable with programmable Web Helpers, including database, video, graphics, social networking and much more. Web Pages References At the end of this tutorial you will find a complete set of ASP.NET references with objects, components, properties and methods.

3 Instructor: Muhammad Saddam Khokhar Indus University Lab INDEX Web Engineering

LAB 2

Introducing ASP.NET Web Pages - Getting Started

This guidance and application gives you an overview of ASP.NET Web Pages (version 2 or later) and Razor syntax, a lightweight framework for creating dynamic websites. It also introduces WebMatrix, a tool for creating pages and sites.

Level: New to ASP.NET Web Pages. Skills assumed: HTML, basic cascading style sheets (CSS). What you'll learn in the first tutorial of the set:

 What ASP.NET Web Pages technology is and what it's for.  What WebMatrix is.  How to install everything.  How to create a website by using WebMatrix.

Features/technologies discussed:

 Microsoft Web Platform Installer.  WebMatrix.  .cshtml pages

Mike Pope originally wrote this tutorial. Tom FitzMacken updated it for Microsoft WebMatrix 3.

Software versions used in the tutorial What Should You Know? We're assuming that you're familiar with:

 HTML. No in-depth expertise is required. We won't explain HTML, but we also don't use anything complex. We'll provide links to HTML tutorials where we think they're useful.

 Cascading style sheets (CSS). Same as with HTML.

 Basic database ideas. If you've used a spreadsheet for data and sorted and filtered the data, that's the level of expertise we're generally assuming for this tutorial set. We're also assuming that you're interested in learning basic programming. ASP.NET Web Pages use a programming language called C#. You don't have to have any background in programming, just an interest in it. If you've ever written any JavaScript in a web page before, you've got plenty of background.

4 Instructor: Muhammad Saddam Khokhar Indus University Lab INDEX Web Engineering

Note that if you are familiar with programming, you might find that this tutorial set initially moves slowly while we bring new programmers up to speed. As we get past the first few tutorials, though, there will be less basic programming to explain and things will move along at a faster clip.

What Do You Need? Here's what you'll need:

 A computer that is running Windows 8, Windows 7, Windows Server 2008, or Windows Server 2012.  A live internet connection.  Administrator privileges (required for the installation process). What Is ASP.NET Web Pages? ASP.NET Web Pages is a framework that you can use to create dynamic web pages. A simple HTML web page is static; its content is determined by the fixed HTML markup that's in the page. Dynamic pages like those you create with ASP.NET Web Pages let you create the page content on the fly, by using code.

Dynamic pages let you do all sorts of things. You can ask a user for input by using a form and then change what the page displays or how it looks. You can take information from a user, save it in a database, and then list it later. You can send email from your site. You can interact with other services on the web (for example, a mapping service) and produce pages that integrate information from those sources.

What is WebMatrix? WebMatrix is a tool that integrates a web page editor, a database utility, a web server for testing pages, and features for publishing your website to the Internet. WebMatrix is free, and it's easy to install and easy to use. (It also works for just plain HTML pages, as well as for other technologies like PHP.)

You don't actually have to use WebMatrix to work with ASP.NET Web Pages. You can create pages by using a text editor, for example, and test pages by using a web server that you have access to. However, WebMatrix makes it all very easy, so these tutorials will use WebMatrix throughout.

5 Instructor: Muhammad Saddam Khokhar Indus University Lab INDEX Web Engineering

LAB #03 Building Web Pages And Web Sites With HTML 5 Introduction

Basic Tags Tags are elements of the HTML language. Almost every kind of tag has an opening symbol and a closing symbol. For example, the tag identifies the beginning of heading information. It also has a closing tag . This element tells browsers that the file is a HTML document. Each HTML document starts with the tag . This tag should be first thing in the document. It has an associate closing tag which must be the last tag in the file. The head contains important information about the document. The title tag is an important tag. It is used to display a title on the top of your browser window. Both the opening and the closing tags go between the head tags.

John's Homepage Another tag that can be added in the head is a tag. It is used to help search engines index a page. There are several different meta names.

The keyword meta. Note that always separate Keywords with a comma:

The following example shows how these tags are coded: 6 Instructor: Muhammad Saddam Khokhar Indus University Lab INDEX Web Engineering

HTML For Beginners The Body Tag is used to identify the start of the main portion of your webpage. Between tags you will place all images, links, text, paragraphs, and forms. We will explain each tag that is used within the body of the HTML file. Character, Paragraph and Position There are six levels of headings, numbered 1 through 6. These tags are used for the characters in the outlines. The biggest heading is

and smallest one is

:

Biggest text

......

smallest text

Paragraph tags (

opening tag and

closing tag) allow you to place a paragraph. For example:

Basic Information

Align The defaulted position is left justification. You can also use "ALIGN" for justification:

Paragraph will be centered

Paragraph will be left justified

Paragraph will be right justified

This kind of tags have capability of allowing you to center the text on the homepage.

Paragraph will be centered


This tag break whatever to be on the next line. The following is an example: 7 Instructor: Muhammad Saddam Khokhar Indus University Lab INDEX Web Engineering

Welcome To
My Homepage!


This tag adds a horizontal line or divider to your web site. An
tag makes the following divider: The
tag can be set as:


  You can add spaces in your text by using  .
You can use this tag to format or remove a text by movinging both the left and right sides of the paragraph.

Welcome To John's Homepage!

Content

Basic Information

8 Instructor: Muhammad Saddam Khokhar Indus University Lab INDEX Web Engineering

Character Style Character styles include physical and logical character styles, and Face, Size, and Color. The following is character style table. Type Choice function

Make text bold.

Make text italic.

Make text underline. Physical Make text strikethrough. styles Make text superscript.

Make text subscript.

Teletype Make text teletype.

Indicate the text is very important.

Indicate the text is important.

Indicate that the text is from a book or other document.

Logical

Indicate that the text is an address. styles Indicate that the text is a definition.

Indicate that the text is a sequence of literal characters.

Keyboard Indicate that the text is keyboard input.

Indicate that the text is a variable.

The tags below have the effect shown on the text in between.

underlined text bold text Italicized text Big text small text Monospaced typewriter text blink (Note: This only works on Netscape) This makes a subscript. This makes a superscript.

9 Instructor: Muhammad Saddam Khokhar Indus University Lab INDEX Web Engineering

strikeout This is a test Text is in the color of Green This is a test You may use this tag to set default font face, size or color for your page and save your time of coding. For example:

Lists There are three kinds of lists in HTML:

Unordered lists

    Unordered Lists This list starts with an opening list
      tag and ends the list with a closing list
    tag. Between the
      and
    , you enter the
  • (list item) tag followed by the individual item; no closing
  • tag is needed. For example:

    • Name
    • Phone
    • ID
    o Name o Phone o ID

    Ordered Lists An orderered list is similar to an unordered list, except it uses

      instead of
        :

        1. College
        2. Hight School
        3. Elemantory School

        The output is: 1. College 2. Hight School 3. Elemantory School 10 Instructor: Muhammad Saddam Khokhar Indus University Lab INDEX Web Engineering

        Definition Lists A definition list starts with

        and ends with
        . This list consists of alternating a definition term and a definition definition. The definition term is enclosed in
        and should precede the definition definition. The definition definition is enclosed in
        . So, a whole definition list looks like:

        term
        definition
        ...
        term
        definition
        Links Links allow you to navigation from one page to another on the internet or in your local machine. Before you add a link to your page you need a URL of another web site or a path of your local file that you want to link to. The link tag also provides the capability to provide a way for linking an e-mail address. To link to another file in your current dictionary, use anchor text . For example:

        Basic Information

        If you want to link to a file that in another dictionary, you can write the code like this:

        Text

        You can create links from your webpage to other webpages on internet:

        Internet College

        If you want link to the an email address and when you click it, then start the mail program, you can write the a link like this:

        Email us

        You can link to any place in other documents by the same way:

        Faculty Infomation

        You also can link a part of another page on the Internet if you can put a pointer in it:

        Image Most Web browsers can display images that are in GIF, or JPEG format. To include an image, enter:

        11 Instructor: Muhammad Saddam Khokhar Indus University Lab INDEX Web Engineering

        For example: The tag is used to define an image. This tag does not have a closing tag. The IMG part tells the browser to add an image, The SRC tells your browser where to find the image. You should include two other attributes on tags to tell your browser the size of the images. The HEIGHT and WIDTH attributes let your browser set aside the appropriate space (in pixels) for the images. For example:

        You can put an image in the left or right of a page by using ALIGN.. For example:

        By default the bottom of an image is aligned with the following text. You can align images to the top, bottom or middle of a paragraph by using one of three things: TOP, MIDDLE, BOTTOM, For example:

        Note: You must use "align", not "valign" to set for TOP, MIDDLE, BOTTOM. It's different from the table alignment. We can use "vspace" and "hspace" to adjust space around the picture: The ALT attribute is one of IMG attributes. You can use the ALT attribute to specify text to be displayed instead of an image. For example:

        [monky]

        In this example, if someone cannot see the image, at least they will be able to read the name of the image and know that it would be a monky because the words "[monky]" is shown in the place. An image can be used as hyperlinks just like plain text. The following is the HTML code:

        The blue border that surrounds the image indicates that it's a clickable hyperlink. If you do not want to display this border, you can add the BORDER attribute and setting it to zero:

        You can load an image from another webpage to your page. To display a image on some one else's page, you need to find the URL:

        You also can use an image as a background. The tag to include a background image is included in the statement as an attribute:

        12 Instructor: Muhammad Saddam Khokhar Indus University Lab INDEX Web Engineering

        A large inline image would slow down the loading of the main document. To avoid it, you may have an image open as an external image. To include a reference to an external image, enter:

        link anchor

        You can also use a smaller image as a link to a larger image. Enter:

        Color You may want to have a specific color for the background, text, links, visited links, and active links. In HTML, Colors are coded as a 6 digit hex RGB (red, green, blue) number. A hexadecimal value in the range 00-FF. For example, 000000 is black (no color at all), FFFFFF is white (fully saturated with all three colors). FF0000 is bright red, 0000FF is bright blue, and 00FF00 is pastel green. You must have the "#" sign before the actual code. You can use the attributes of the tag to change the color of text, links, vlinks (visited links), and alinks (active links). For example:

        You can also use the name of the color instead of the corresponding RGB value to indicate some basic colors. For example, "black", "red", "blue", and "green" are all valid for use in place of RGB values. Coloring specific text is done very much like changing the font size. The tag is like:

        text

        This tag can be combined with the font size. For example:

        text Table The format of table is:

        ... ... ...
        Table Entry Table Entry
        Table Entry Table Entry

        The whole table is opened and closed with

        . Each row is encapsulated in . Within the row are cells, enclosed in . There can be as many rows and columns as you want and as will fit on the screen. The browser will autoformat the rows, vertically centering cell contents if necessary. If you want a cell to span more than one

        13 Instructor: Muhammad Saddam Khokhar Indus University Lab INDEX Web Engineering column, enclose it in , where X indicate the number of columns to span. Similarly, will cause the cell to span X rows. A border can be placed around all the cells by using

        , where X is the number of pixels thick the border should be. Let's see an example:

        Name
        Phone
        ID
        John Lee
        456-968
        276580
        Cherry Heitz
        789-326
        908743

        Name Phone ID

        John Lee 456-968 276580

        Cherry Heitz 789-326 908743

        The value of width and height can be "xx%" or XX. For example: WIDTH="80%" or WIDTH=450. "xx%" allow the table size changing while the window size is changing. The value of Border can be zero. In this case, the table will have no border. You can make a table looking like this: The following is the code of this table.

        Input You can use "input" for single line information:

        For example:

        14 Instructor: Muhammad Saddam Khokhar Indus University Lab INDEX Web Engineering

        Your Email Address Your Name Subject

        Here is what the result shows:

        Your Email Address Your Name Subject

        The value of size is in characters, so "SIZE=26" means the width of the input box is 26 characters. Text Area Text Area can be as big as you'd like. Text Area begins with . For example:

        The result is: