Chapter 1-1.

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

Unit – 1 Introduction to ASP.

NET
• History of Asp.Net
• Introduction to Asp.Net
• Features of Asp.Net
• Structure of Asp.Net Page
• ASP.NET Web Pages Model(Single Page Model, Two Page Model)

History of ASP.Net:
✓ ASP .Net is a Microsoft technology for building web applications that leverages all
the fantastic technologies you can find in .NET Framework.
✓ ASP.Net is an exiciting web programming technology pioneered by Microsoft that
allows developers to create dynamic web pages.
✓ ASP.Net is a robust and mature technology. Asp.NET version 1.0 was released in
January 2002 and quickly became the web programming technology of choice for
many. In November 2005, Microsoft released the much-anticipated version 2.0. Two
years later, in November 2007, Microsoft released ASP.Net version 3.2. And
ASP.NET 4 was inveiled in April 2010.
✓ SQL Server 2008 is a database engine, which is a specialised application designed to
efficiently store and query data. Many websited interact with databases; any
ecommerce website, for example, displays product information and records purchase
orders in a database.
Introduction to ASP.NET :
✓ What is ASP.NET?
o It is a technology for internet programming.
o It is a powerful tool for web application.
o Web application is a web site containing as many pages and data stored in a
database.
o Web page is a form in a website. It is a fundamental component of ASP.NET.
o ASP.NET is the technology that can be employed to create dynamic web
pages.
o Contents of dynamic web application are normally stored in a database that
can be loaded to the page and the page contains only controls.
o Visual Studio is an IDE for all the Microsoft .Net framework form and
window development.
o A technology to develop content-rich dynamic and personalized websites.
✓ How does ASP.NET work?

Fig.: Programmatic work flow of ASP.NET application.


Features of ASP.NET:
1) High Performance: Performance is always a critical feature for any of the applications or
software. Due to its ASP.NET Core and web server, it’s remarked as the fastest and quick
web application framework. So, it is fast because ASP.NET uses compiler-based
technology.
2) Cross-Platform and Container Support: As we say it supports cross-platform means it
supports Windows, macOS, and Linux. So, if we create ASP.NET application then we can
directly deploy it on these platforms.
3) Asynchronous via Async/Await: Asynchronous programming patterns is now implemented
in all .net frameworks classes and 3rd party libraries. ASP.Net is faster, because of its wide
use of asynchronous patterns in frameworks.
4) Rich Development Environments: If we are creating the application then we will use IDE
i.e Visual Studio. It provides a rich development environment by which we can easily drag
and drop the components (radio buttons, checkboxes, etc.) and create the application.
5) Language Independent: The framework is language independent that is developers can use
various languages like C#. So, it’s easy for a developer to make its application by language
which they know. We can create a dynamic web application using any of the languages.
6) Globalization and Localization: We host the web application and it can be accessed from
anywhere globally. So, language, date and time format, number format, the currency must
be different for different regions or countries. ASP.NET supports globalization so that
different countries’ clients or people also can understand and they can access this
application.
7) Security: As it supports the .Net framework so it will provide security for our application.
Applications have its individual identity, so before running it checks its identity of those
objects. It will also check the operating system security. Due to its pre-application
configuration and feature of built-in windows authentication, our developed application is
safe and secure. With built-in Windows authentication and per-application configuration,
your applications are safe and secured.
8) Supports for HTML5 Form Types: It provides support for HTML5 form types. There the
new controls are available in HTML5 like email, URL, Number, RNGE, Date pickers
(week, date, month, time, DateTime-local, etc.), color and search.
9) .NET Web API: This includes ASP.NET web forms. HTTP services are easily consumed
and build with the help of ASP.NET Web API.
Structure of ASP.NET page:
✓ ASP .NET Websites and Web pages:
o ASP.NET web pages are simple text files, meaning that you can create them
using any text editor (such as Microsoft Notepad), but if you have created
websites before, you know that using a tool such as Microsoft Expression.
o Web or Adobe Dreamweaver makes the development process much easier than
using generic text editors such as Notepad. This is the caser for ASP.NET, as
well.
o Before we create our first ASP.NET website, we need to install the .NET
Framework, Visual Web Developer, and SQL Server.
o The .NET Framework is a rich platform for creating Windows-based
applications and is the underlying technology used to create ASP.NET websites.
✓ Dynamic Web sites with ASP.NET:
Fig.: Dynamic website with ASP.Net
✓ Web Application:
o A collection of Web pages, comprising images, videos and other digital assets
providing relevant information.
o A web application makes use of the Internet to make itself accessible to users
from all over the world through web browsers.
o In order to develop Web Application, one should be well-conversant with
ASP.NET technology.
✓ Usage of Web Applications: Web applications serve the following fields-
o Communication
o Shopping
o Searching
o Education
o Entertainment

Fig.: Working of server-side scripts.


Fig.: Working of client-side scripts.
ASP.NET Web Page Model:
There are two types of web page model.
A. Single Page Model
B. Two Page Model
A. Single Page Model: In a traditional Web app, every time the app calls the server, the
server renders a new HTML
page. A Single File Mode
application means you will
write and compile your C# or
VB.NET code in the ASP.NET
page itself inline. There will be
no code behind file. This
triggers a page refresh in the
browser. Single-Page
Applications (SPAs) are Web
apps that load a single HTML
page and dynamically update
that page as the user interacts
with the app.
One benefit of SPAs is
obvious: Applications are more
fluid and responsive, without the jarring effect of reloading and re-rendering the page
This separation makes it easier to design and evolve each layer. In a well-architected SPA,
you can change the HTML markup without touching the code that implements the application
logic.
In a pure SPA, all UI interaction occurs on the client side, through JavaScript and CSS. After
the initial page load, the server acts purely as a service layer. The client just needs to know
what HTTP requests to send. It doesn’t care how the server implements things on the back
end.
With this architecture, the client and the service are independent. You could replace
the entire back end that runs the service, and as long as you don’t change the API, you won’t
break the client. The reverse is also true—you can replace the entire client app without
changing the service layer. For example, you might write a native mobile client that
consumes the service
B. Two page model/ Code behind model: In ASP.NET, the code-behind model consisted
of an ASPX file (the Webform) and a code-behind file containing programming code. The two
files were connected using the @Page directive in the ASPX file. Each control on the ASPX
page had a corresponding declaration in the code-behind file as an instance variable. The code-
behind file also contained code for event binding and generated code necessary for the Visual
Studio designer. This model worked fairly well, but because every ASP.NET element in the
ASPX page required corresponding code in the code-behind file, there was no true separation
of code and content.
A typical @ Page directive might look like this:
<%@Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs"
Inherits="_Default" %>
A typical class definition in an ASP.NET 2.0 code-behind file might look like this:
public partial class _Default : System.Web.UI.Page
The new model enhances the code-behind model because developers will now have
code files that contain only the code that they have created. It also provides for a true separation
of code and content because there are no instance variable declarations in the code-behind file.

*****

You might also like