Download as pdf or txt
Download as pdf or txt
You are on page 1of 18

Lavin Institute for computer science

5th stage programming


ASP. Net topics for year
2017-2018

Tutor
Barkhawan Othman Ameen
Study.material1960@gmail.com

1
Preferred topics

• What is Web programming


• Web Browser
• What is visual studio
• Integrated Development Environment (IDE)
• C#
• Object-Oriented Programming (OOP)
• SQL
• What is MVC?
• What is a Web Server?
• IIS server
• AJAX/ ASP.NET AJAX
• What is API?
• NET Framework
• What is HTML?
• What is CSS?
• What is Java Script?
• What is JQuery?
• Bootstrap
• ASP.NET
• ASP.NET Web Forms (.aspx pages)
• ASP.NET MVC
• ASP.NET Web Pages (.cshtml and .vbhtml files)

2
What is Web programming
Today most of the applications focus on the Internet, where the applications can be
viewed in a standard Web Browser. Static Web pages are based on HTML and
CSS. In order to create more advanced applications, we need more powerful tools.

A useful web site for learning more about web development:


http://www.w3schools.com
Important frameworks and tools for creating dynamic web pages:

• ASP.NET
• AJAX/ ASP.NET AJAX

• JavaScript

• Silverlight

Web Browser
The purpose of a web browser is to read HTML documents and compose them into
visual or audible web pages. The browser does not display the HTML tags, but
uses the tags to interpret the content of the page.

Today we have the following major Web Browsers:


• Internet Explorer (by Microsoft)
• Firefox (by Mozilla)
• Chrome (by Google)
• Safari (by Apple)

• Opera (by Opera from Norway)

3
What is visual studio

Microsoft Visual Studio is an integrated development environment (IDE) from


Microsoft. It can be used to develop console and graphical user interface
applications along with Windows Forms applications, web sites, web applications,
and web services in both native code together with managed code for all platforms
supported by Microsoft Windows, Windows Phone, Windows CE, .NET
Framework, .NET Compact Framework and Microsoft Silverlight.

Integrated Development Environment (IDE)


The Visual Studio product family shares a single integrated development
environment (IDE) that is composed of several elements: the Menu bar, Standard
toolbar, various tool windows docked or auto-hidden on the left, bottom, and right
sides, as well as the editor space. The tool windows, menus, and toolbars available
depend on the type of project or file you are working in.

C#
C# is pronounced “see sharp”. C# is an object-oriented programming language and
part of the .NET family from Microsoft. C# is very similar to C++ and Java. C# is
developed by Microsoft and works only on the Windows platform.

Object-Oriented Programming (OOP)


Object-oriented programming (OOP) is a programming language model organized
around "objects" rather than "actions" and data rather than logic. Historically, a
program has been viewed as a logical procedure that takes input data, processes it,
and produces output data.

4
SQL
SQL (Structured Query Language) is a database computer language designed for
managing data in relational database management systems (RDBMS).
28 Working with Databases in ASP.NET Tutorial: ASP.NET and Web
Programming SQL, is a standardized computer language that was originally
developed by IBM for querying, altering and defining relational databases, using
declarative statements.
SQL is pronounced /ˌɛs kjuː ˈɛl/ (letter by letter) or /ˈsiːkwəl/ (as a word).

What can SQL do?


• SQL can execute queries against a database
• SQL can retrieve data from a database
• SQL can insert records in a database
• SQL can update records in a database
• SQL can delete records from a database
• SQL can create new databases
• SQL can create new tables in a database
• SQL can create stored procedures in a database
• SQL can create views in a database
• SQL can set permissions on tables, procedures, and views
Even if SQL is a standard, many of the database systems that exist today
implement their own version of the SQL language.

What is MVC

The Model-View-Controller (MVC) architectural pattern separates an application


into three main components: the model, the view, and the controller. The
ASP.NET MVC framework provides an alternative to the ASP.NET Web Forms
pattern for creating Web applications. The ASP.NET MVC framework is a

5
lightweight, highly testable presentation framework that (as with Web Forms-
based applications) is integrated with existing ASP.NET features, such as master
pages and membership-based authentication. The MVC framework is defined in
the System.Web.Mvc assembly.

MVC design pattern

MVC is a standard design pattern that many developers are familiar with. Some
types of Web applications will benefit from the MVC framework. Others will
continue to use the traditional ASP.NET application pattern that is based on Web
Forms and postbacks. Other types of Web applications will combine the two
approaches; neither approach excludes the other.

The MVC framework includes the following components:

• Models. Model objects are the parts of the application that implement the
logic for the application's data domain. Often, model objects retrieve and
store model state in a database. For example, a Product object might retrieve
information from a database, operate on it, and then write updated
information back to a Products table in a SQL Server database.

In small applications, the model is often a conceptual separation instead of a


physical one. For example, if the application only reads a dataset and sends
it to the view, the application does not have a physical model layer and

6
associated classes. In that case, the dataset takes on the role of a model
object.

• Views. Views are the components that display the application's user
interface (UI). Typically, this UI is created from the model data. An example
would be an edit view of a Products table that displays text boxes, drop-
down lists, and check boxes based on the current state of a Product object.
• Controllers. Controllers are the components that handle user interaction,
work with the model, and ultimately select a view to render that displays UI.
In an MVC application, the view only displays information; the controller
handles and responds to user input and interaction. For example, the
controller handles query-string values, and passes these values to the model,
which in turn might use these values to query the database.[1]

What is a Web Server?

Visual Studio has its own ASP.NET engine which is responsible for running your
web application so you don't have any problems running an ASP.NET application
from the VS IDE. When you want to host your site for others to access, the concept
of a "Web Server" comes into picture. A web server is responsible for providing a
response to requests that come from clients. So when multiple users come in,
multiple requests also come in and the web server will have a response for each of
them. IIS (Internet Information Server) is one of the most powerful web servers
from Microsoft that is used to host ASP.NET web applications. IIS has its own
ASP.NET Process to handle ASP.NET requests. If you look at this picture:

7
IIS Server Overview

The first client will make a request to the web server (IIS), the web server checks
the request and will pass the request to the ASP.NET Process (don't get confused
here, I have explained the details), the ASP.NET process engine will process the
request and pass the response to the client via the web server. One of the major
roles of IIS is handling each and every request. Don't worry, I have explained each
and everything in more detail later. So far I hope it is clear why we are using a web
server.

Introduction to IIS

IIS 6.0 provides a redesigned World Wide Web Publishing Service architecture
that can help you achieve better performance, reliability, scalability, and security
for your web sites. In this section, I have described an overview of IIS and an
installation guide for IIS 6.0.

Overview of IIS

Internet Information Server is one of the most powerful web servers provided by
Microsoft that is able to host and run your web applications. IIS supports the
following protocols: FTP, FTPS, SMTP, NNTP, HTTP/HTTPS. We can host our
web sites on IIS, we can use it as an FTP site also.

8
IIS Version in Different OSs

Below is a list of IIS versions that support the following Operating Systems:

Operating System IIS Version


Windows Server 2008 IIS 7.0
Windows Vista - Home Premium/ Ultimate IIS 7.0
Windows Server 2003 IIS 6.0
Windows XP Professional IIS 5.1
Windows 2000 Server IIS 5.0 IIS 5.0
[2]

AJAX/ ASP.NET AJAX


AJAX is an acronym for Asynchronous JavaScript and XML. AJAX is a group of
interrelated web development methods used on the client-side to create interactive
web applications.
With Ajax, web applications can send data to, and retrieve data from, a server
asynchronously (in the background) without interfering with the display and
behavior of the existing page.
ASP.NET AJAX is a set of extensions to ASP.NET developed by Microsoft for
implementing.

What is API

ASP.NET Web API. ASP.NET Web API is a framework that makes it easy to
build HTTP services that reach a broad range of clients, including browsers and
mobile devices. ASP.NET Web API is an ideal platform for building RESTful
applications on the .NET Framework

9
NET Framework
The .NET Framework (pronounced “dot net”) is a software framework that runs
primarily on Microsoft Windows. It includes a large library and supports several
programming languages which allow language interoperability (each language can
use code written in other languages). The .NET library is available to all the
programming languages that .NET supports. Programs written for the .NET
Framework execute in a software environment, known as the Common Language
Runtime (CLR), an application virtual machine that provides important services
such as security, memory management, and exception handling.

The class library and the CLR together constitute the .NET Framework.

What is HTML?

HTML is the standard markup language for creating Web pages.

• HTML stands for Hyper Text Markup Language


• HTML describes the structure of Web pages using markup
• HTML elements are the building blocks of HTML pages
• HTML elements are represented by tags
• HTML tags label pieces of content such as "heading", "paragraph", "table",
and so on
• Browsers do not display the HTML tags, but use them to render the content
of the page

A Simple HTML Document Example

<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>

10
</head>
<body>

<h1>My First Heading</h1>


<p>My first paragraph.</p>

</body>
</html> [3]

What is CSS?

CSS is a language that describes the style of an HTML document.

CSS describes how HTML elements should be displayed.

CSS Example

body {
background-color: lightblue;
}

h1 {
color: white;
text-align: center;
}

p{
font-family: verdana;
font-size: 20px;
}

11
What is Java Script?

JavaScript is a programming language used to make web pages interactive. It is


what gives a page life, the interactive elements and animation that engage a user. If
you've ever used a search box on a home page, checked a live baseball score on a
news site or watched a video, JavaScript is probably running through it[4]

What is JQuery
jQuery is a fast, small, and feature-rich JavaScript library. It makes things like
HTML document traversal and manipulation, event handling, animation, and Ajax
much simpler with an easy-to-use API that works across a multitude of browsers.
With a combination of versatility and extensibility, jQuery has changed the way
that millions of people write JavaScript[5]

What is Bootstrap

Bootstrap is an open-source Javascript framework developed by the team at


Twitter. It is a combination of HTML, CSS, and Javascript code designed to help
build user interface components. Bootstrap was also programmed to support both
HTML5 and CSS3.

Also it is called Front-end-framework.

Bootstrap is a free collection of tools for creating a websites and web applications.

It contains HTML and CSS-based design templates for typography, forms, buttons,
navigation and other interface components, as well as optional JavaScript
extensions.

Some Reasons for programmers preferred Bootstrap Framework

12
- Easy to get started
- Great grid system
- Base styling for most HTML
elements(Typography,Code,Tables,Forms,Buttons,Images,Icons)
- Extensive list of components
- Bundled Javascript plugins[6]

What is ASP.Net?
ASP.NET is a web application framework developed by Microsoft to allow
programmers to build dynamic web sites, web applications and web services.
ASP.NET is part of the Visual Studio package.
It was first released in January 2002 with version 1.0 of the .NET Framework, and
is the successor to Microsoft's Active Server Pages (ASP) technology. ASP.NET is
built on the Common Language Runtime (CLR), allowing programmers to write
ASP.NET code using any supported .NET language, such as C# and VB.NET.
ASP.NET web pages or webpage, known officially as Web Forms], are the main
building block for application development. Web forms are contained in files with
an “.aspx” extension.

The Three Flavors of ASP.NET: Web Forms, MVC, and Web Pages

ASP.NET offers three frameworks for creating web applications: ASP.NET Web
Forms, ASP.NET MVC, and ASP.NET Web Pages. All three frameworks are
stable and mature, and you can create great web applications with any of them.

Each framework targets a different audience or type of application. Which one you
choose depends on a combination of your web development experience, what
framework you’re most comfortable with, and which is the best fit for the type of
application you’re creating. All three frameworks will be supported, updated, and
improved in future releases of ASP.NET.

13
Here's an overview of each of the frameworks and some ideas for how to choose
between them.

ASP.NET Web Forms (.aspx pages)

The Web Forms framework targets developers who prefer declarative and control-
based programming, such as Microsoft Windows Forms (WinForms) and
WPF/XAML/Silverlight. It offers a WYSIWYG designer-driven (drag-and-drop)
development model, so it's popular with developers looking for a rapid application
development (RAD) environment for web development. If you’re new to web
programming and are familiar with the traditional Microsoft RAD client
development tools (for example, for Visual Basic and Visual C#), you can quickly
build a web application without having expertise in HTML and JavaScript.

In particular, the Web Forms model provides the following features:

• An event model that exposes events which you can program like you would
program a client application like WinForms or WPF.
• Server controls that render HTML for you and that you can customize by
setting properties and styles.
• A rich assortment of controls for data access and data display.
• Automatic preservation of state (data) between HTTP requests, which makes
it easy for a programmer who is accustomed to client applications to learn
how to create applications for the stateless web.

Web Forms works well for small teams of Web developers and designers who
want to take advantage of the large number of components available for rapid
application development. In general, creating a Web Forms application requires
less programming effort than creating the same application by using the ASP.NET
MVC framework. The components (the Page class, controls, and so on) are tightly
integrated and usually require less code than ASP.NET MVC applications.

14
However, Web Forms is not just for rapid application development. There are
many complex commercial apps and app frameworks built on top of Web Forms.

Because a Web Forms page and the controls on the page automatically generate
much of the markup that's sent to the browser, you don't have the kind of fine-
grained control over the HTML that the other ASP.NET models offer. An event-
driven, control-focused model hides some of the behavior of HTML and HTTP.
For example, it's not always possible to specify exactly what markup might be
generated by a control.

The Web Forms model doesn't lend itself as readily as ASP.NET MVC to patterns-
based development, separation of concerns, and automated unit testing. If you want
to write code factored that way, you can; it’s just not as automatic as it is in the
ASP.NET MVC framework. The ASP.NET Web Forms MVP project shows an
approach that facilitates separation of concerns and testability while maintaining
the rapid development that Web Forms was built to deliver. As an example of this
in action, Microsoft SharePoint is built using Web Forms MVP.

ASP.NET MVC

ASP.NET MVC targets developers who are interested in patterns and principles
like test-driven development, separation of concerns, inversion of control (IoC),
and dependency injection (DI). This framework encourages separating the business
logic layer of a web application from its presentation layer.

By dividing the application into the model (M), views (V), and controllers (C),
ASP.NET MVC can make it easier to manage complexity in larger applications.
With ASP.NET MVC, you can have multiple teams working on a web site because
the code for the business logic is separate from the code and markup for the
presentation layer — developers can work on the business logic while designers
work on the markup and JavaScript that is sent to the browser.

15
With ASP.NET MVC, you work more directly with HTML and HTTP than in Web
Forms. Web Forms tends to hide some of that by mimicking the way you would
program a WinForms or WPF application. For example, Web Forms can
automatically preserve state between HTTP requests, but you have to code that
explicitly in MVC. The MVC model enables you to take complete control over
exactly what your application is doing and how it behaves in the web environment.

MVC was designed to be extensible, providing power developers the ability to


customize the framework for their application needs. In addition, the ASP.NET
MVC source code is available under an OSI license.

MVC 4 includes a feature that helps you develop HTTP services that reach a broad
range of clients, including browsers and mobile devices. For more information, see
Getting Started with ASP.NET Web API. MVC 4 also helps you develop single-
page applications (SPAs) that use client-side JavaScript for responsive client
interaction. For more information, see Single Page Application Overview.

For more information about ASP.NET MVC, see ASP.NET MVC.

ASP.NET Web Pages (.cshtml and .vbhtml files)

ASP.NET Web Pages targets developers who want a simple web development
story, along the lines of PHP. In the Web Pages model, you create HTML pages
and then add server-based code to the page in order to dynamically control how
that markup is rendered. Web Pages is specifically designed to be a lightweight
framework, and it's the easiest entry point into ASP.NET for people who know
HTML but might not have broad programming experience — for example,
students or hobbyists. It's also a good way for web developers who know PHP or
similar frameworks to start using ASP.NET.

Like Web Forms, Web Pages is oriented toward rapid development. Web Pages
provides components called helpers that you can add to pages and that let you use

16
just a few lines of code to perform tasks that would either be tedious or complex.
For example, there are helpers to display database data, add a Twitter feed, log in
using Facebook, add maps to a page, and so on.

Web Pages provides a simpler approach than Web Forms. If you look at a .cshtml
or .vbhtml file, you can generally think of the logic as executing top-to-bottom in
the file, as you would with PHP, SHTML, etc. And because .cshtml and .vbhtml
files are essentially HTML files that have additional ASP.NET code in them, they
lend themselves easily to adding client-side functionality via JavaScript and
jQuery.

For more information about ASP.NET Web Pages, see ASP.NET Web Pages [7]

Recommended tutorials:
1- Kurdish : https://www.youtube.com/watch?v=WOLpMj2mgHk
2- Arabic : https://www.youtube.com/watch?v=3rP7gy9lD2E
3- English: https://www.youtube.com/watch?v=KVlXccl-XBA

17
References

1- https://msdn.microsoft.com/en-

us/library/dd381412(v=vs.108).aspx
2- https://www.codeproject.com/Articles/42724/Beginner-s-
Guide-Exploring-IIS-With-ASP-NET
3- https://www.w3schools.com/html/html_intro.asp

4- https://www.thoughtco.com/what-is-javascript-2037921

5- https://jquery.com/

6- https://stackoverflow.com/questions/14546709/what-is-
bootstrap

7- https://msdn.microsoft.com/en-

us/library/4w3ex9c2.aspx#wf_mvc_wp

18

You might also like