Asp 200531103252
Asp 200531103252
NET
What is ASP.NET ?
ASP.NET: server side technology for creating dynamic web pages using Fully Fledged
programming languages supported by .NET
ASP.NET applications are compiled codes, written using the extensible and reusable
components or objects present in .Net framework. These codes can use the entire
hierarchy of classes in .Net framework.
7. All the processes are closely monitored and managed by the ASP.NET runtime,
so that if process is dead, a new process can be created in its place, which helps
keep your application constantly available to handle requests.
10. ASP.NET makes for easy deployment. There is no need to register components
because the configuration information is built-in.
11. The Web server continuously monitors the pages, components and applications
running on it. If it notices any memory leaks, infinite loops, other illegal
activities, it immediately destroys those activities and restarts itself.
12. Easily works with ADO.NET using data-binding and page formatting features. It
is an application which runs faster and counters large volumes of users without
having performance problems
Difference between ASP and ASP.NET
1. ASP is interpreted, ASP.NET is compiled.
2. Classic ASP uses a technology called ADO to connect and work with
databases. ASP.NET uses the ADO.NET technology
3. ASP has Mixed HTML and coding logic where in asp.net html and
coding part are separated by code behind files.
4. ASP.NET purely object oriented whereas ASP is partially object
oriented.
5. For ASP No in-built support for XML whereas in ASP.NET full XML
Support for easy data exchange.
6. In Asp Error handling is very poor where in asp.net full proof error
handling is possible
7. ASP has no in built validation control. Meaning that validating page is
difficult for developers.Asp.net has in built rich validation set.
8. No built in support for XML in ASP but in asp.net it is.
9. Limited session and application state management in ASP but in asp.net
it is complete.
LIFE CYCLE
ASP.NET life cycle specifies how:
ASP.NET processes pages to produce dynamic output
The application and its pages are instantiated and processed
ASP.NET compiles the pages dynamically
ASP.NET life cycle could be divided into two groups:
Application Life Cycle
Page Life Cycle
ASP.NET Application Life Cycle
The application life cycle has the following stages:
1. User makes a request for accessing application resource, a page. Browser
Page Directives
Code Section
Page Layout
Page Directives
The page directives set up the environment for the
page to run. The @Page directive defines page-specific
attributes used by ASP.NET page parser and compiler.
Page directives specify how the page should be
processed, and which assumptions need to be taken
about the page.
It allows importing namespaces, loading assemblies,
and registering new controls with custom tag names
and namespace prefixes.
Code Section
The code section provides the handlers for the page
and control events along with other functions
required.
The code section or the code behind file provides all
event handler routines, and other functions used by
the developer. The page code could be precompiled
and deployed in the form of a binary assembly.
Page Layout
The page layout provides the interface of the page. It contains the server
controls, text, inline JavaScript, and HTML tags.
The following code snippet provides a sample ASP.NET page explaining
Page directives, code section and page layout written in C#:
CONTROLS
Controls are small building blocks of the graphical user interface, which
include text boxes,buttons, check boxes, list boxes, labels, and numerous
other tools. Using these tools, the users can enter data, make selections and
indicate their preferences.
Controls are also used for structural jobs, like validation, data access,
security, creating master pages, and data manipulation.
ASP.NET uses five types of web controls:
• HTML controls
• HTML Server controls
• ASP.NET Server controls
• ASP.NET Ajax Server controls
• User controls and custom controls
The HTML server controls are basically the standard HTML controls
enhanced to enable server side processing. The HTML controls such as the
header tags, anchor tags, and input elements are not processed by the server
but are sent to the browser for display.
ASP.NET HTML Server Controls
ASP.NET provides a way to work with HTML Server controls on the
server side; programming with a set of controls collectively is called HTML
Controls.
These controls are grouped together in the Visual Studio Toolbox in the the
HTML Control tab. The markup of the controls are similar to the HTML
control.
These controls are basically the original HTML controls but enhanced to
enable server side processing.
HTML elements in ASP. NET files are, by default, treated as text. To make
these elements programmable, add a runat="server" attribute to the HTML
element. This attribute indicates that the element should be treated as a
server control.
Note:
All HTML server controls must be within a <form> tag with the
runat="server" attribute. The runat="server" attribute indicates that the form
should be processed on the server. It also indicates that the enclosed
controls can be accessed by server scripts.
NOT RECOMMENDED.
Interweave2.aspx A Server
control
script language="VB" runat="server">
Sub Page_Load()
Message.Text="The ASP.NET line"
End Sub
</script>
<html>
<head> <title>Inserting ASP.NET code Example</TITLE>
</head>
<body>
First HTML Line<br/>
<asp:label id=Message runat="server"/> <br />
Second HTML Line<br/>
</body>
Web application project files
AssemblyInfo.vb Info about the compiled project file stored in
/bin and named project.dll
Global.asax Event handler commands visible to all web
forms in a project
Global.asax.resx Define application resources such as text
strings, images. Can change without
recompiling project.
Global.asax.vb Asp.net code for application events eg
session.start
Project.sln Stores links to all project files
Project.suo VS.NET IDE configuration info for the proj.
Project.vbproj Configuration and build settings for project
files.
Web application project files
cont.
Project.vbproj.webinfo URL to project web server
Project.vsdisco Enables search for web services
Styles.css Project style sheet
Web.config Project and folder configuration information
Webform.aspx Web form .aspx file;Html
Webform.aspx.resx Resources in corresponding web form
Webform.aspx.vb Code written for the form (code behind)
Bin\project.dll Compiled project output file (assembly)