.net training | learn .net | Microsoft dot net Course | Microsoft dot net online training
Introduction to ASP Dot Net
-
Upload
indrajit-chavan -
Category
Documents
-
view
246 -
download
0
Transcript of Introduction to ASP Dot Net
-
8/3/2019 Introduction to ASP Dot Net
1/18
Introduction
What is ASP.NET?
ASP.NET is a server side scripting technology that enables scripts
(embedded in web pages) to be executed by an Internet server.
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
IIS comes as a free component with Windows servers
IIS is also a part of Windows 2000 and XP Professional
-
8/3/2019 Introduction to ASP Dot Net
2/18
What is an ASP.NET File?
An ASP.NET file is just the same as an HTML file
An ASP.NET file can contain HTML, XML, and scripts
Scripts in an ASP.NET file are executed on the server
An ASP.NET file has the file extension ".aspx
How Does ASP.NET Work?
When a browser requests an HTML file, the server returns the file
When a browser requests an ASP.NET file, IIS passes the request tothe ASP.NET engine on the server
The ASP.NET engine reads the file, line by line, and executes thescripts in the file
Finally, the ASP.NET file is returned to the browser as plain HTML
Introduction
-
8/3/2019 Introduction to ASP Dot Net
3/18
The Microsoft .NET Framework
The .NET Framework is the infrastructure for the Microsoft .NET
platform.
The .NET Framework is an environment for building, deploying, and
running Web applications and Web Services.
.NET Frameworks keywords:
Easier and quicker programming
Reduced amount of code
Declarative programming model
Richer server control hierarchy with events
Larger class library
Better support for development tools
-
8/3/2019 Introduction to ASP Dot Net
4/18
The .NET Framework consists of 3 main parts:
Programming languages:
C# (Pronounced C sharp)
Visual Basic (VB .NET)
J# (Pronounced J sharp)
Server technologies and client technologies:
ASP .NET (Active Server Pages)
Windows Forms (Windows desktop solutions)
Compact Framework (PDA / Mobile solutions)
Development environments:
Visual Studio .NET (VS .NET)
Visual Web Developer
The Microsoft .NET Framework
-
8/3/2019 Introduction to ASP Dot Net
5/18
Three Tier Architecture in ASP.NET
-
8/3/2019 Introduction to ASP Dot Net
6/18
Three Tier Architecture in ASP.NET
These layers are described below.
1. Application layer or Business layer2. Business layer
a. Property layer(Sub layer of business layer)
3. data layer
-
8/3/2019 Introduction to ASP Dot Net
7/18
Application layer is the form where we design using the controls like
textbox, labels, command buttons etc.
Business layer is the class where we write the functions which getthe data from the application layer and passes through the dataaccess layer.
Data layer is also the class which gets the data from the businesslayer and sends it to the database or gets the data from thedatabase and sends it to the business layer.
Property layer is the sub layer of the business layer in which wemake the properties to sent or get the values from the applicationlayer. These properties help to sustain the value in a object so thatwe can get these values till the object destroy.
Three Tier Architecture in ASP.NET
-
8/3/2019 Introduction to ASP Dot Net
8/18
ASP.NET Web Server Controls
-
8/3/2019 Introduction to ASP Dot Net
9/18
ASP.NET Web Server Controls
Standard Toolbox Controls
Data Toolbox Controls
Validation Toolbox Controls
Navigation Toolbox Controls
Login Toolbox Controls
WebParts Toolbox Controls
HTML Controls for ASP.NET Web Pages
Ajax Server Controls
Microsoft Ajax Extender Controls
http://msdn.microsoft.com/en-us/library/x8k61whf.aspxhttp://msdn.microsoft.com/en-us/library/s1c14y5c.aspxhttp://msdn.microsoft.com/en-us/library/ah5a961d.aspxhttp://msdn.microsoft.com/en-us/library/c4hb2k3a.aspxhttp://msdn.microsoft.com/en-us/library/tz6e5ezc.aspxhttp://msdn.microsoft.com/en-us/library/tz6e5ezc.aspxhttp://msdn.microsoft.com/en-us/library/t5d54cf8.aspxhttp://msdn.microsoft.com/en-us/library/bb386522.aspxhttp://msdn.microsoft.com/en-us/library/bb532368.aspxhttp://msdn.microsoft.com/en-us/library/bb532368.aspxhttp://msdn.microsoft.com/en-us/library/bb386522.aspxhttp://msdn.microsoft.com/en-us/library/t5d54cf8.aspxhttp://msdn.microsoft.com/en-us/library/tz6e5ezc.aspxhttp://msdn.microsoft.com/en-us/library/tz6e5ezc.aspxhttp://msdn.microsoft.com/en-us/library/tz6e5ezc.aspxhttp://msdn.microsoft.com/en-us/library/tz6e5ezc.aspxhttp://msdn.microsoft.com/en-us/library/c4hb2k3a.aspxhttp://msdn.microsoft.com/en-us/library/ah5a961d.aspxhttp://msdn.microsoft.com/en-us/library/s1c14y5c.aspxhttp://msdn.microsoft.com/en-us/library/x8k61whf.aspx -
8/3/2019 Introduction to ASP Dot Net
10/18
Asp.net Page life Cycle
-
8/3/2019 Introduction to ASP Dot Net
11/18
Asp.net Page life Cycle
-
8/3/2019 Introduction to ASP Dot Net
12/18
Life-Cycle Events PreInit :-
Raised after the start stage is complete and before the initialization stage
begins. Use this event for the following:
Check the IsPostBack property to determine whether this is the first time
the page is being processed. The IsCallback and IsCrossPagePostBack
properties have also been set at this time.
Create or re-create dynamic controls.
Set a master page dynamically.
Set the Theme property dynamically.
Read or set profile property values.
Init :-Raised after all controls have been initialized and any skin settings have
been applied. The Init event of individual controls occurs before the Init
event of the page.
Use this event to read or initialize control properties.
http://msdn.microsoft.com/en-us/library/system.web.ui.page.preinit.aspxhttp://msdn.microsoft.com/en-us/library/system.web.ui.page.ispostback.aspxhttp://msdn.microsoft.com/en-us/library/system.web.ui.page.iscallback.aspxhttp://msdn.microsoft.com/en-us/library/system.web.ui.page.iscrosspagepostback.aspxhttp://msdn.microsoft.com/en-us/library/system.web.ui.page.theme.aspxhttp://msdn.microsoft.com/en-us/library/system.web.ui.control.init.aspxhttp://msdn.microsoft.com/en-us/library/system.web.ui.control.init.aspxhttp://msdn.microsoft.com/en-us/library/system.web.ui.control.init.aspxhttp://msdn.microsoft.com/en-us/library/system.web.ui.control.init.aspxhttp://msdn.microsoft.com/en-us/library/system.web.ui.control.init.aspxhttp://msdn.microsoft.com/en-us/library/system.web.ui.control.init.aspxhttp://msdn.microsoft.com/en-us/library/system.web.ui.control.init.aspxhttp://msdn.microsoft.com/en-us/library/system.web.ui.control.init.aspxhttp://msdn.microsoft.com/en-us/library/system.web.ui.page.theme.aspxhttp://msdn.microsoft.com/en-us/library/system.web.ui.page.iscrosspagepostback.aspxhttp://msdn.microsoft.com/en-us/library/system.web.ui.page.iscallback.aspxhttp://msdn.microsoft.com/en-us/library/system.web.ui.page.ispostback.aspxhttp://msdn.microsoft.com/en-us/library/system.web.ui.page.preinit.aspx -
8/3/2019 Introduction to ASP Dot Net
13/18
General Page life-Cycle Stages
InitComplete :-
Raised at the end of the page's initialization stage. Only one
operation takes place between the Init and InitComplete events:
tracking of view state changes is turned on. View state tracking
enables controls to persist any values that are programmatically
added to the ViewState collection. Until view state tracking is
turned on, any values added to view state are lost across postbacks.Controls typically turn on view state tracking immediately after they
raise their Init event.
Use this event to make changes to view state that you want to
make sure are persisted after the next postback.
PreLoad :-
Raised after the page loads view state for itself and all controls, and
after it processes postback data that is included with the Request
instance.
http://msdn.microsoft.com/en-us/library/system.web.ui.page.initcomplete.aspxhttp://msdn.microsoft.com/en-us/library/system.web.ui.control.init.aspxhttp://msdn.microsoft.com/en-us/library/system.web.ui.page.initcomplete.aspxhttp://msdn.microsoft.com/en-us/library/system.web.ui.control.viewstate.aspxhttp://msdn.microsoft.com/en-us/library/system.web.ui.control.init.aspxhttp://msdn.microsoft.com/en-us/library/system.web.ui.page.preload.aspxhttp://msdn.microsoft.com/en-us/library/system.web.ui.page.preload.aspxhttp://msdn.microsoft.com/en-us/library/system.web.ui.page.request.aspxhttp://msdn.microsoft.com/en-us/library/system.web.ui.page.request.aspxhttp://msdn.microsoft.com/en-us/library/system.web.ui.page.preload.aspxhttp://msdn.microsoft.com/en-us/library/system.web.ui.page.preload.aspxhttp://msdn.microsoft.com/en-us/library/system.web.ui.control.init.aspxhttp://msdn.microsoft.com/en-us/library/system.web.ui.control.viewstate.aspxhttp://msdn.microsoft.com/en-us/library/system.web.ui.page.initcomplete.aspxhttp://msdn.microsoft.com/en-us/library/system.web.ui.control.init.aspxhttp://msdn.microsoft.com/en-us/library/system.web.ui.page.initcomplete.aspx -
8/3/2019 Introduction to ASP Dot Net
14/18
General Page life-Cycle Stages Load :-
The Page object calls the OnLoad method on the Page object, and
then recursively does the same for each child control until the pageand all controls are loaded. The Load event of individual controls
occurs after the Load event of the page.
Use the OnLoad event method to set properties in controls and to
establish database connections. Control events:-
Use these events to handle specific control events, such as a Button
control's Click event or a TextBox control's TextChanged event.
LoadComplete :- Raised at the end of the event-handling stage.
Use this event for tasks that require that all other controls on the
page be loaded.
http://msdn.microsoft.com/en-us/library/system.web.ui.control.load.aspxhttp://msdn.microsoft.com/en-us/library/system.web.ui.page.aspxhttp://msdn.microsoft.com/en-us/library/system.web.ui.control.onload.aspxhttp://msdn.microsoft.com/en-us/library/system.web.ui.page.aspxhttp://msdn.microsoft.com/en-us/library/system.web.ui.control.load.aspxhttp://msdn.microsoft.com/en-us/library/system.web.ui.control.load.aspxhttp://msdn.microsoft.com/en-us/library/system.web.ui.control.onload.aspxhttp://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.button.aspxhttp://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.button.click.aspxhttp://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.textbox.aspxhttp://msdn.microsoft.com/en-us/library/system.web.ui.mobilecontrols.textbox.textchanged.aspxhttp://msdn.microsoft.com/en-us/library/system.web.ui.page.loadcomplete.aspxhttp://msdn.microsoft.com/en-us/library/system.web.ui.page.loadcomplete.aspxhttp://msdn.microsoft.com/en-us/library/system.web.ui.page.loadcomplete.aspxhttp://msdn.microsoft.com/en-us/library/system.web.ui.page.loadcomplete.aspxhttp://msdn.microsoft.com/en-us/library/system.web.ui.mobilecontrols.textbox.textchanged.aspxhttp://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.textbox.aspxhttp://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.button.click.aspxhttp://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.button.aspxhttp://msdn.microsoft.com/en-us/library/system.web.ui.control.onload.aspxhttp://msdn.microsoft.com/en-us/library/system.web.ui.control.load.aspxhttp://msdn.microsoft.com/en-us/library/system.web.ui.control.load.aspxhttp://msdn.microsoft.com/en-us/library/system.web.ui.page.aspxhttp://msdn.microsoft.com/en-us/library/system.web.ui.control.onload.aspxhttp://msdn.microsoft.com/en-us/library/system.web.ui.page.aspxhttp://msdn.microsoft.com/en-us/library/system.web.ui.control.load.aspx -
8/3/2019 Introduction to ASP Dot Net
15/18
General Page life-Cycle Stages PreRender :-
Raised after the Page object has created all controls that are
required in order to render the page, including child controls ofcomposite controls. (To do this, the Page object calls
EnsureChildControls for each control and for the page.
The Page object raises the PreRender event on the Page object, and
then recursively does the same for each child control. ThePreRender event of individual controls occurs after the PreRender
event of the page.
Use the event to make final changes to the contents of the page or
its controls before the rendering stage begins.
PreRenderComplete:-
Raised after each data bound control whose DataSourceID property
is set calls its DataBind method.
http://msdn.microsoft.com/en-us/library/system.web.ui.control.prerender.aspxhttp://msdn.microsoft.com/en-us/library/system.web.ui.page.aspxhttp://msdn.microsoft.com/en-us/library/system.web.ui.page.aspxhttp://msdn.microsoft.com/en-us/library/system.web.ui.control.ensurechildcontrols.aspxhttp://msdn.microsoft.com/en-us/library/system.web.ui.page.aspxhttp://msdn.microsoft.com/en-us/library/system.web.ui.control.prerender.aspxhttp://msdn.microsoft.com/en-us/library/system.web.ui.page.aspxhttp://msdn.microsoft.com/en-us/library/system.web.ui.control.prerender.aspxhttp://msdn.microsoft.com/en-us/library/system.web.ui.control.prerender.aspxhttp://msdn.microsoft.com/en-us/library/system.web.ui.page.prerendercomplete.aspxhttp://msdn.microsoft.com/en-us/library/system.web.ui.page.prerendercomplete.aspxhttp://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.databoundcontrol.datasourceid.aspxhttp://msdn.microsoft.com/en-us/library/system.web.ui.control.databind.aspxhttp://msdn.microsoft.com/en-us/library/system.web.ui.page.savestatecomplete.aspxhttp://msdn.microsoft.com/en-us/library/system.web.ui.control.databind.aspxhttp://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.databoundcontrol.datasourceid.aspxhttp://msdn.microsoft.com/en-us/library/system.web.ui.page.prerendercomplete.aspxhttp://msdn.microsoft.com/en-us/library/system.web.ui.page.prerendercomplete.aspxhttp://msdn.microsoft.com/en-us/library/system.web.ui.control.prerender.aspxhttp://msdn.microsoft.com/en-us/library/system.web.ui.control.prerender.aspxhttp://msdn.microsoft.com/en-us/library/system.web.ui.page.aspxhttp://msdn.microsoft.com/en-us/library/system.web.ui.control.prerender.aspxhttp://msdn.microsoft.com/en-us/library/system.web.ui.page.aspxhttp://msdn.microsoft.com/en-us/library/system.web.ui.control.ensurechildcontrols.aspxhttp://msdn.microsoft.com/en-us/library/system.web.ui.page.aspxhttp://msdn.microsoft.com/en-us/library/system.web.ui.page.aspxhttp://msdn.microsoft.com/en-us/library/system.web.ui.control.prerender.aspx -
8/3/2019 Introduction to ASP Dot Net
16/18
General Page life-Cycle Stages SaveStateComplete :-
Raised after view state and control state have been saved for the
page and for all controls. Any changes to the page or controls at thispoint affect rendering, but the changes will not be retrieved on the
next postback.
Render :-
This is not an event; instead, at this stage of processing, the Pageobject calls this method on each control. All ASP.NET Web server
controls have a Render method that writes out the control's
markup to send to the browser.
Unload :-
Raised for each control and then for the page.
In controls, use this event to do final cleanup for specific controls,
such as closing control-specific database connections.
http://msdn.microsoft.com/en-us/library/system.web.ui.page.savestatecomplete.aspxhttp://msdn.microsoft.com/en-us/library/system.web.ui.page.savestatecomplete.aspxhttp://msdn.microsoft.com/en-us/library/system.web.ui.page.savestatecomplete.aspxhttp://msdn.microsoft.com/en-us/library/system.web.ui.control.render.aspxhttp://msdn.microsoft.com/en-us/library/system.web.ui.control.render.aspxhttp://msdn.microsoft.com/en-us/library/system.web.ui.page.aspxhttp://msdn.microsoft.com/en-us/library/system.web.ui.control.render.aspxhttp://msdn.microsoft.com/en-us/library/system.web.ui.control.unload.aspxhttp://msdn.microsoft.com/en-us/library/system.web.ui.control.unload.aspxhttp://msdn.microsoft.com/en-us/library/system.web.ui.control.unload.aspxhttp://msdn.microsoft.com/en-us/library/system.web.ui.control.unload.aspxhttp://msdn.microsoft.com/en-us/library/system.web.ui.control.render.aspxhttp://msdn.microsoft.com/en-us/library/system.web.ui.page.aspxhttp://msdn.microsoft.com/en-us/library/system.web.ui.control.render.aspxhttp://msdn.microsoft.com/en-us/library/system.web.ui.control.render.aspxhttp://msdn.microsoft.com/en-us/library/system.web.ui.page.savestatecomplete.aspx -
8/3/2019 Introduction to ASP Dot Net
17/18
The following figure illustrates how the server controls
on an ASP.NET page is processed by the server
-
8/3/2019 Introduction to ASP Dot Net
18/18