Introduction to Asp.
net
What is web application?
Web Application is any software which runs in web browser with support of
internet.
Advantages of web application?
Uses a technology independent thin client (web browser ) ex IE,Mozilla etc.
You can access application from any devices. (Desktop, laptop,tab,mobile
etc).
Difference between Web and Win app
Windows Web
It is stand alone t is distributed
Modification required in all Only single machine need to
machine update
Security is not big concern Security is big issue
In Some app it uses LAN It uses internet
2-tier architecture
3-tier architecture
3-Tier architecture is very famous and well known in world of software
development. If we analyze any traditional project then we will find that most
of (at least 60-70 %) them has traditional N-Tier, basically 3-Tier architecture.
It does not matter whether it is web or windows application, we can
implement 3-Tier architecture in any type of environment.
Difference between Tier and Layer
Tier represents different hardware box. Means the components are physically
separated to different machines. But in case of layer all component remains in same
system.
What are the Layers?
Layer indicates logical separation of components, such as having distinct
namespaces and classes for the Database Access Layer, Business Logic Layer and
User Interface Layer.
Theoretically it is N-Tier architecture. So, we can create as much layer as possible
but basically people classify code in three different categories and put them in three
different layers
Presentation Layer/ UI Layer
This is the top most layer of application where user performs their activity. Let’s
take example of any application where user needs to fill up one form. This form is
nothing nut presentation layer. In windows application windows form is presentation
layer and in web application web form belongs to presentation layer. Basically
user’s input validation and rule processing performs in this layer.
Business Layer
This is on top of presentation layer. As the name suggest, most of the business
operation performs here. For example, after collecting form data we want to
validate them with our custom business rule. Basically we define classes and
business entities in this layer.
Data Access Layer
It is on top of Business Logic Layer Data Access Layer presents. It contains methods
that helps business layer to connect with database and perform CRUD operation. In
data access layer generally all database related code and stuff belongs to.
Sometimes people use platform independent data access layer to fetch data from
different database vendor.
Client side scripting
Client Side Scripting: Client side scripting are written using scripting languages.
They are created using languages like HTML,DHTML,Javascript.
Server Side Scripting
In server Side programming web application are executed at server side. They are
created using languages like Java, C#,PHP etc. technology to develop web
application is Asp.net ,JSP ,PHP etc.
servers
Formerly called internet information server .It is a web server application and
includes a set of modules, these modules are individual features that the server
uses to process HTTP requests.
HTTP and HTTP methods
HTTP functions as a request-resp protocol in the client-server computing model.
A web brow , for example, may be the client and an application running on a
computer host a web- site may be the server. HTTP is called a stateless protocol
because each command is executed independently
Get: The GET method is used to retrieve information from the given server using a
given URI. Requests using GET should only retrieve data and should have no other
effect on the data.
Post: A POST request is used to send data to the server, for example customer
information, file upload etc using HTML forms.
Introduction to asp.net
ASP.NET is a Microsoft Technology
· ASP stands for Active Server Pages
· ASP.NET is a program that runs inside IIS
· IIS (Internet Information Services) is Microsoft's Internet server.
Difference between Asp and Asp.net
Asp Asp.net
It uses different scripting languages You can create ASP.NET applications
to create dynamic Web pages, which in most of the .NET compatible
can be run on any type of browser languages, such as Visual Basic, C#,
and J#.
It is interpreted It is compiled
It has mixed html and coding logic It separate html and coding part by
code behind file.
It don’t have xml support Full Xml support
Multi language was not supported Multi language supported
Step to create asp.net web application using VS
Step 1: Creating the Web Application Project
Select File > New Web Site... and choose ASP.NET Empty Web Site in the
Templates pane.
Select File System from the drop-down list closest to Location.
Set the Language to Visual C#, and click OK.
Asp.net web application structure.
App_Code: Contains source code for shared classes and business objects
(for example, ..cs, and .vb files) that you want to compile as part of your
application
App_Data: Contains application data files including .mdf database files, XML
files,
and other data store files.
App_GlobalResources: Contains resources (.resx and .resources files) that are
compiled
into assemblies with global scope
App_Themes: Contains a collection of files (.skin and .css files, as well as
image files
and generic resources) that define the appearance of ASP.NET Web pages
and controls
Creation of Asp.net enviornment
1)Request come to IIS than it process the request depending upon extension.
2)All Asp.net functionality runs within the scope of worker process (w3wp).
3)if it is a first request to website class called Application manager creates a
app domain. Which is isolation between two application hosted on same
server.
4)Newly created app domain created hosting environment ‘HTTP Runtime’.
Once hosting environment created than core asp.net object like HTTP
Context HTTP req and HTTP res created.
5) once all core asp.net object is created than if you have global.asx file in
your application it is created it is only first time creation.
6)HTTP application than start the processing the request by http module ,
events, handler and page event
Page life cycle
Pre_Init
Init
Init complete
Pre load
Load
Control Event
Load complete
Pre-render
Pre render complete
Save state complete
Render
Unload