Introduction To ASP
Introduction To ASP
Introduction To ASP
NET
ASP.NET
To Build Web Based Application on .NET Platform, We must use ASP.NET Web
Application Framework or Web Application Development Platform.
According to Microsoft, "ASP.NET is a web technology for building powerful, dynamic
Web applications and is part of the .NET Framework".
ASP.NET is an open source server-side Web application framework designed for
Web development to produce dynamic Web pages. It was developed by Microsoft to
allow programmers to build dynamic web sites, web applications and web services. 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 Visual C# or VB.Net.
ASP.NET provides a unified Web development model that includes the services
necessary for you to build enterprise-class Web applications. While ASP.NET is largely
syntax compatible with Active Server Pages (ASP), it provides a new programming
model and infrastructure that allow you to create a powerful new class of
applications. ASP.NET is part of the .NET Framework and allows you to take full
advantage of the features of the common language runtime, such as type safety,
inheritance, language interoperability, and versioning.
ASP.NET (Active Server Page for .NET)
Developer(s)
Microsoft
Initial Release
January 2002
Stable Release
4.5 / 15 August 2012; 2
years ago
Preview Release
5.0 / 12 November 2014;
3 months ago
Written in
.NET languages
Operating System
Microsoft Windows
Type
Web
application
framework
Website
www.asp.net
ASP.NET is more than the next version of Active Server Pages (ASP); it provides
a unified Web development model that includes the services necessary for
developers to build enterprise-class Web applications. While ASP.NET is largely
syntax compatible with ASP, it also provides a new programming model and
infrastructure for more scalable and stable applications that help provide greater
protection. You can feel free to enhance your existing ASP applications by
incrementally adding ASP.NET functionality to them.
In other words you can say:
ASP.Net is a programming framework used to develop web applications and
web services with the help of any .NET compatible language such as C# or VB.NET.
Basically it is next generation of classic asp. It provides the easy way to build, deploy
& run web application via any browser interface.
ASP.Net is a web development platform, which provides a programming model,
a comprehensive software infrastructure and various services required to build up
robust web application for PC, as well as mobile devices.
.NET is language independent, which means we can use any .NET supported
language to make .NET applications. The most common languages for writing
ASP.NET applications are C# and VB.NET. While VB.NET is directly based on VB
(Visual Basic), C# was introduced together with the .NET framework, and is therefore
1
a somewhat new language. Some people call C# "The .NET Language", but
according to Microsoft, we can do all the same things, no matter if we're using C# or
VB.NET.
Prerequisites of ASP.NET:
Before proceeding with ASP.NET you should have a basic understanding of
.NET programming language, text editor and execution of programs etc. Because we
are going to develop web based applications using ASP.NET web application
framework, so it will be good if you have understanding on other web technologies
like, HTML, CSS, and JavaScript etc.
These are following major elements:
OR
A web application is a collection of static and dynamic web pages. A static web
page is one that does not change when a user requests it: the web server sends the
page to the requesting web browser without modifying it.
In contrast, a dynamic web page is modified based upon client supplied input
value by the server before it is sent to the requesting browser. The changing nature
of the page is why its called dynamic.
Easier to develop
More useful for users
Easier to install and maintain and keep secure
Easier to extend
Web applications commonly use a combination of server-side script (ASP, PHP,
JSP, ASP.NET etc.) and client-side script (HTML, JavaScript, etc.) to develop the
application. The client-side script deals with the presentation of the information while
the server-side script deals with all the hard stuff like storing and retrieving the
information.
Web Application resides with web server which will located under network server.
Clients are going to interact with web server via following some open standard:
1. Web Server:
It is software which is responsible to serve all the requests which are in the form of
HTTP.
OR
A web server is software that serves files in response to requests from web
browsers. A web server is sometimes called an HTTP server. Common web servers
include IIS, Netscape Enterprise Server, iPlanet Web Server, and Apache Tomcat.
2. Web Browser:
It is software which resides on client system and it is responsible to make
request in the form of HTTP and HTTP is the open standard protocol which is
applicable for different types of or all types of users. HTTP derived from W3 ORG.
3. HTML (Hyper Text Markup Language):
HTML is a light weight language which is used for showing output in the
browsers.
Using HTML, we can design the web pages that are displayed in the client browser.
Every web application must produce to output to the client in HTML form only. Any
language we use at the server but the outcome of this program should be
HTML.HTML can be used only to design static pages that are non-interactive pages.
HTML doesnt have any programming capabilities and also doesnt have error
handling and debugging support. With HTML, we can design a web site (noninteractive) but not web application (interactive).
5
.NET Extensibility (on Windows 7 and Windows Server 2008) or .NET Extensibility 4.5
(onWindows 8 and Windows Server 2012)
ASP.NET (on Windows 7 and Windows Server 2008) or ASP.NET 4.5
(on Windows 8 and Windows Server 2012)
ISAPI Extensions
ISAPI Filters
Request Filtering
Windows Authentication
Static Content
HTTP Activation
The procedure is slightly different for the different versions of Windows. For more
details, see the following below sections:
The following procedure describes how to install IIS and the required features for the
Microsoft Dynamics NAV Web client, including HTTP activation, on Windows 7.
To install IIS features on Windows 7
1. On the Start menu, choose Control Panel, and then choose Programs.
2. Under Programs and Features, choose Turn Windows features on or off.
3. In the Windows features list, expand Internet Information Services, and then
expand World
Wide Web Services.
4. Expand Application Development Features, and select the following features:
.NET Extensibility
ASP.NET
ISAPI Extensions
ISAPI Filters
5. Expand Security, and then select the following features:
Request Filtering
Windows Authentication
6. Expand Common HTTP Features, and then select the Static Content feature.
7. To install Internet Information Service (IIS) Manager, under Internet Information
Services, expand Web Management Tools, and then select IIS Management
Console.
This step is optional. You use Internet Information Service IIS Manager to manage
local and remote web servers and sites.
8. Choose the OK button to complete the installation.
9. In the Windows features list, expand Microsoft .NET Framework, and then
select Windows
Communication Foundation HTTP Activation.
10. To verify that the web server has been installed correctly, start your browser, and
then type
http://localhost in the address.
The default web site opens and should display an IIS 7 image. If the IIS 7
image does not appear, then verify that you have configured static content on IIS, as
described in step 6.
Note:
To open Internet Information Services (IIS) Manager, on the Start menu, in the
Search Programs and Files box, type inetmgr, and then press Enter.
Installing IIS:
IIS in Windows is still an optional Windows Feature. To install it, press the
Windows + R key combination to bring up a run box, then type appwiz.cpl and press
enter.
This will open the Program and Features part of Control Panel, on the left hand
side click on the Turn Windows features on or off link.
Click Program and Features Option from above All Control Panel Items
Window. This will open the Program and Features part of Control Panel, on the left
hand side click on the Turn Windows features on or off link.
Window Features will open. Now scroll down until you see Internet
Information Services in the list. Go ahead and click in the empty checkbox next to
the title. It should turn into a small black square.
10
Note that having the black square instead of the checkmark just means that
not all of the sub-items are being installed. For example, by default, checking IIS will
not install the FTP server option. If you want to install FTP Server, you have to
expand the + box and manually check it. Go ahead and click OK at this point and
Windows 8 will install IIS 8. You shouldnt need the DVD to install IIS.
After clicking OK, this dialog will appear on your screen for a while.
11
Next, you can then go to Control Panel and click on Administrative Tools. Here
you will see Internet Information Services (IIS) Manger. Youll get the familiar IIS
console screen:
On the left hand side, you can expand out the server to see the list of sites. To
start, you only have the Default Web Site, which is stored under
C:\inetpub\wwwroot.
12
Use the notepad text editor to create all web pages as following:
Home.htm:
<html>
<head>
<title>Home Page</title>
</head>
<body style="background-color: yellow">
<img src="Images/Ads1.jpg" width="100%" height="150" alt="This is Banner Image" />
<div align="center">
<a href="Home.htm">Home</a>
|
<a href="AboutUs.htm">About Us</a>
|
<a href="Services.htm">Services</a>
|
<a href="ContactUs.htm">Contact Us</a>
</div>
<hr />
<h1>:: Home Page Contents::</h1>
</body>
</html>
AboutUs.htm:
<html>
<head>
<title>About Us Page</title>
</head>
<body style="background-color: Aqua">
<img src="Images/Ads2.jpg" width="100%" height="150" alt="This is Banner Image" />
<div align="center">
<a href="Home.htm">Home</a>
|
<a href="AboutUs.htm">About Us</a>
|
<a href="Services.htm">Services</a>
|
<a href="ContactUs.htm">Contact Us</a>
</div>
<hr />
<h1>:: About Us Page Contents::</h1>
</body> </html>
13
Services.htm:
<html>
<head>
<title>Services Page</title>
</head>
<body style="background-color: green">
<img src="Images/Ads3.jpg" width="100%" height="150" alt="This is Banner
Image" />
<div align="center">
<a href="Home.htm">Home</a>
|
<a href="AboutUs.htm">About Us</a>
|
<a href="Services.htm">Services</a>
|
<a href="ContactUs.htm">Contact Us</a>
</div>
<hr />
<h1>::Services Page Contents::</h1>
</body>
</html>
ContactUs.htm:
<html>
<head>
<title>Contact Us Page</title>
</head>
<body style="background-color: lime">
<img src="Images/Ads4.jpg" width="100%" height="150" alt="This is Banner
Image" />
<div align="center">
<a href="Home.htm">Home</a>
|
<a href="AboutUs.htm">About Us</a>
|
<a href="Services.htm">Services</a>
|
<a href="ContactUs.htm">Contact Us</a>
</div>
<hr />
<h1>::Contact Us Page Contents::</h1>
</body>
</html>
Once The Website is ready with their resources as shown above, You
required to Host or setup a website on a given web server i.e. IIS
Hosting a Web Site to an IIS Web Server:
These are following steps to host or setup a Website to an IIS Webserver:
1. Open IIS Manger
2. To setup a new website in IIS 8, expand Server (Machine Name) -> Sites ->
Default Web Site
3. Right-Click on Default Web Site and choose Add Application and enter the details
as following:
14
If you click any of the link such as Home, About Us, Services, Contact Us it
redirects to their corresponding page to show the page contents.
Web Application Development:
Web application development is the process of developing web applications.
These are the following Web Technologies:
CGI
Perl
15
PHP
ColdFusion
JSP
ASP
Servlets
ASP.NET
ASP.NET:
ASP.NET is a most acceptable technology for creating strongest, dynamic &
scalable Web applications.
ASP.NET is part of the .NET Framework and allows us to take full advantage of
the features of the common language runtime, such as type safety, inheritance,
language interoperability, and versioning.
ASP.Net is a web development platform, which provides a programming model,
a comprehensive software infrastructure and various services required to build up
robust web application for PC, as well as mobile devices.
ASP.NET is a web application framework developed and marketed by Microsoft
to allow programmers to build dynamic web sites, web applications and web
services. 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 Visual C# or VB.NET.
File Name Extension: .aspx
ASP.NET Versions:
The ASP.NET releases with the .NET Framework releases:
ASP.NET
ASP.NET
ASP.NET
ASP.NET
ASP.NET
ASP.NET
ASP.NET
ASP.NET
1.0
1.1
2.0
3.0
3.5
3.5
4.0
4.5
(2002)
(2003)
(2005)
(2006) Due to WCF (.Net Framework 3.0)
(2007)
Service Pack 1 (2008)
(2010)
(2012)
ASP.NET
Version
1.0
Feature Details
16
1.1
2.0
3.5
4.0
4.5
4.5.1
Hypertext:
It refers to the way in which Web pages (HTML documents) are linked
together. When you click a link in a Web page, you are using hypertext.
Markup Language:
It describes how HTML works. With a markup language, you simply "markup"
a text document with tags that tell a Web browser how to structure it to display.
CSS:
CSS stands for Cascading Style Sheet. And it is used to control the style of a
web document in a simple and easy way.
CSS handles the look and feel part of a web page. Using CSS, we can control
the color of the text, the style of fonts, the spacing between paragraphs, how
columns are sized and laid out, what background images or colors are used, as well
as a variety of other effects.
CSS provides powerful control over the presentation of an HTML document.
Most commonly, CSS is combined with the markup languages HTML or XHTML.
JavaScript:
18
.NET Framework
Microsoft Internet Information Services (IIS)
Goals of ASP.NET:
These are following:
Keep the good parts of Classic ASP and improve the rest of things
Simplify: less code, easier to create and maintain
Multiple, compiled languages
Fast and scalable
Manageable
Customizable and extensible
Secure
Tool support
20
C# (Pronounced C sharp)
Visual Basic (VB.NET)
ASP.NET Framework
Mainly, Asp.Net can be divides into two parts - Asp.Net Sites and Asp.Net
Services.
Asp.NET Site:
There are following flavours of Asp.NET Site Web Forms:
This is the traditional event driven development model. It has drag and drop
server controls, server events and state management techniques. This best for rapid
application development (RAD) with powerful data access.
22
MVC:
This is a lightweight and MVC (Model, View, and Controller) pattern based
development model. It provides full control over mark-up and support many features
that allow fast & agile development.
This best for developing lightweight,
interactive and device oriented (i.e. compatible to smart phones, iPhone, tablet,
laptop etc.) web application with latest web standards.
Web Pages:
This is also a lightweight and Razor syntax based development model. It has
built-in template and helpers also provide full control over mark-up. It is best for
developing beautiful web application with latest web standards. You can also use
WebMatrix which is a free tool and has built-in template; for developing Asp.Net Web
Page.
SPA:
SPA stands for Single Page Application which helps you to build web
applications that include significant client-side interactions using HTML5, CSS3 and
JavaScript. It is best to make highly interactive single page dashboard web
applications.
Asp.NET Services:
Web API:
Asp.Net Web API is a framework for building HTTP services that can be
consume by a broad range of clients including Browsers, Mobiles, iPhone and Tablets.
SignalR:
ASP.NET SignalR is a library that simplifies the process of adding real-time web
functionality to applications. Real-time web functionality is the ability to have server
code push content to connected clients instantly as it becomes available, rather than
having the server wait for a client to request new data.
Visual Studio 2012:
The Visual Studio IDE offers a set of tools that help you to write and modify the
code for your programs, and also detect and correct errors in your programs. Using
Visual Studio 2012 you can build Windows Store apps, desktop apps, mobile apps,
ASP.NET web apps, and web services.
23