ASP.NET
ASP.NET
NET
It is a web framework designed and developed by Microsoft. It is used to
develop websites, web applications and web services. It provides fantastic
integration of HTML, CSS and JavaScript. It was first released in January
2002. It is built on the Common Language Runtime (CLR) and allows
programmers to write code using any supported .NET language.
April 12, 4.0 The two new properties added in the Page class ar
2010 MetaKeyword and MetaDescription.
August 15, 4.5
2012
May 5, 2014 4.5.2 Higher reliability HTTP header inspection and modificatio
methods
New way to schedule background asynchronous worker task
1. Web Forms
2. ASP.NET MVC
3. ASP.NET Web Pages
Web Forms
It is an event driven development framework. It is used to develop
application with powerful data access. It provides server side controls and
events to create web application. It is part of the ASP.NET framework. We will
discuss it further in next chapters.
ASP.NET MVC
It gives us a MVC (Model View Controller), patterns-based way to build
dynamic websites. It enables a clean separation of concerns and that gives
you full control over markup for enjoyable, agile development. It also
provides many features that enable fast development for creating
outstanding applications. We will discuss it further in next chapters.
ASP.NET Web Pages
It is used to create dynamic web pages. It provides fast and lightweight way
to combine server code with HTML. It helps to add video, link to the social
sites. It also provides other features like you can create beautiful sites that
conform to the latest web standards.
All these are stable and well equipped frameworks. We can create web
applications with any of them. These are also based on the .NET Framework
and share core functionalities of .NET and ASP.NET.
MVC Ruby on Full control over HTML markup, code and markup Mid-Level,
Rails, .NE separated, and easy to write tests. The best Advanced
T choice for mobile and single-page applications
(SPA).
Web Classic HTML markup and your code together in the same New, Mid
Pages ASP, PHP file Level
Stage Description
Page request This stage occurs before the lifecycle begins. When a page is requested by th
user, ASP.NET parses and compiles that page.
Start In this stage, page properties such as Request and response are set. It als
determines the Request type.
Initialization In this stage, each control's UniqueID property is set. Master page is applied t
the page.
Load During this phase, if page request is postback, control properties are loaded wit
information.
Postback In this stage, event handler is called if page request is postback. After that, th
event Validate method of all validator controls is called.
handling
Rendering Before rendering, view state is saved for the page and all controls. During th
rendering stage, the page calls the Render method for each control, providing
text writer that writes its output to the OutputStream object of the page'
Response property.
Unload At this stage the requested page has been fully rendered and is ready t
terminate.at this stage all properties are unloaded and cleanup is performed.
A requested page first loaded into the server memory after that processes
and sent to the bowser. At last it is unloaded from the server memory.
ASP.NET provides methods and events at each stage of the page lifecycle
that we can use in our application. In the following table, we are tabled
events.
PreInit This event is raised after the start stage is complete and before th
initialization stage.
Init This event occurs after all controls have been initialized
We can use this event to read or initialize control properties.
InitComplete This event occurs at the end of the page's initialization stage
We can use this event to make changes to view state that we want to mak
sure are persisted after the next postback.
PreLoad This event is occurs before the post back data is loaded in the controls.
Load This event is raised for the page first time and then recursively for all chil
controls.
Control events This event is used to handle specific control events such as Button contro
Click event.
PreRender This event occurs after the page object has created all controls that ar
required in order to render the page.
PreRenderCompl This event occurs after each data bound control whose DataSourceID
ete property is set calls its DataBind method.
SaveStateCompl It is raised after view state and control state have been saved for the pag
ete and for all controls.
Render This is not an event; instead, at this stage of processing, the Page object call
this method on each control.
Unload This event raised for each control and then for the page.