SlideShare uma empresa Scribd logo
1 de 11
Naveen Kumar Veligeti

Beginners Introduction to ASP.NET

Introduction
I have seen many tutorials on ASP.NET but most of them starts with coding and writing your first
ASP.NET Program. But here I has written this tutorial for explaining why there is a need for ASP.NET
when classy ASP is working fine and what are the underlying technology behind ASP.NET, What
programming model ASP.NET Provides to programmers. Now let us get started.
ASP.NET is the new offering for Web developers from the Microsoft .It is not simply the nextgeneration of ASP; in fact, it is a completely re-engineered and enhanced technology that offers
much, much more than traditional ASP and can increase productivity significantly.
Because it has evolved from ASP, ASP.NET looks very similar to its predecessor—but only at first
sight. Some items look very familiar, and they remind us of ASP. But concepts like Web Forms, Web
Services, or Server Controls gives ASP.NET the power to build real Web applications.

Looking Back : Active Server Pages (ASP)
Microsoft Active Server Pages (ASP) is a server-side scripting technology. ASP is a technology that
Microsoft created to ease the development of interactive Web applications. With ASP you can use
client-side scripts as well as server-side scripts. Maybe you want to validate user input or access a
database. ASP provides solutions for transaction processing and managing session state. Asp is one
of the most successful language used in web development.

Problems with Traditional ASP
There are many problems with ASP if you think of needs for Today's powerful Web applications.
1. Interpreted and Loosely-Typed Code
ASP scripting code is usually written in languages such as JScript or VBScript. The script-execution
engine that Active Server Pages relies on interprets code line by line, every time the page is called. In
addition, although variables are supported, they are all loosely typed as variants and bound to
particular types only when the code is run. Both these factors impede performance, and late binding
of types makes it harder to catch errors when you are writing code.
2. Mixes layout (HTML) and logic (scripting code)
ASP files frequently combine script code with HTML. This results in ASP scripts that are lengthy,
difficult to read, and switch frequently between code and HTML. The interspersion of HTML with ASP

1
Naveen Kumar Veligeti
code is particularly problematic for larger web applications, where content must be kept separate
from business logic.
3. Limited Development and Debugging Tools
Microsoft Visual InterDev, Macromedia Visual UltraDev, and other tools have attempted to increase
the productivity of ASP programmers by providing graphical development environments. However,
these tools never achieved the ease of use or the level of acceptance achieved by Microsoft Windows
application development tools, such as Visual Basic or Microsoft Access. ASP developers still rely
heavily or exclusively on Notepad.
Debugging is an unavoidable part of any software development process, and the debugging tools
for ASP have been minimal. Most ASP programmers
resort to embedding temporary Response. Write statements in their code to trace the progress of its
execution.
4. No real state management
Session state is only maintained if the client browser supports cookies. Session state information can
only be held by using the ASP Session object. And you have to implement additional code if you, for
example, want to identify a user.
5. Update files only when server is down
If your Web application makes use of components, copying new files to your application should only
be done when the Web server is stopped. Otherwise it is like pulling the rug from under your
application's feet, because the components may be in use (and locked) and must be registered.
6. Obscure Configuration Settings
The configuration information for an ASP web application (such as session state and server timeouts)
is stored in the IIS metabase. Because the metabase is stored in a proprietary format, it can only be
modified on the server machine with utilities such as the Internet Service Manager. With limited
support for programmatically manipulating or extracting these settings, it is often an arduous task to
port an ASP application from one server to another.

Introducing ASP.NET
ASP.NET was developed in direct response to the problems that developers had with classic ASP.
Since ASP is in such wide use, however, Microsoft ensured that ASP scripts execute without
modification on a machine with the .NET Framework (the ASP engine, ASP.DLL, is not modified when
installing the .NET Framework). Thus, IIS can house both ASP and ASP.NET scripts on the same
machine.

Advantages of ASP.NET
1. Separation of Code from HTML
To make a clean sweep, with ASP.NET you have the ability to completely separate layout and
business logic. This makes it much easier for teams of programmers and designers to collaborate

2
Naveen Kumar Veligeti
efficiently. This makes it much easier for teams of programmers and designers to collaborate
efficiently.
2. Support for compiled languages
developer can use VB.NET and access features such as strong typing and object-oriented
programming. Using compiled languages also means that ASP.NET pages do not suffer the
performance penalties associated with interpreted code. ASP.NET pages are precompiled to bytecode and Just In Time (JIT) compiled when first requested. Subsequent requests are directed to the
fully compiled code, which is cached until the source changes.
3. Use services provided by the .NET Framework
The .NET Framework provides class libraries that can be used by your application. Some of the key
classes help you with input/output, access to operating system services, data access, or even
debugging. We will go into more detail on some of them in this module.
4. Graphical Development Environment
Visual Studio .NET provides a very rich development environment for Web
developers. You can drag and drop controls and set properties the way you do in Visual Basic 6. And
you have full IntelliSense support, not only for your code, but also for HTML and XML.
5. State management
To refer to the problems mentioned before, ASP.NET provides solutions for session and application
state management. State information can, for example, be kept in memory or stored in a database. It
can be shared across Web farms, and state information can be recovered, even if the server fails or
the connection breaks down.
6. Update files while the server is running!
Components of your application can be updated while the server is online and clients are connected.
The Framework will use the new files as soon as they are copied to the application. Removed or old
files that are still in use are kept in memory until the clients have finished.
7. XML-Based Configuration Files
Configuration settings in ASP.NET are stored in XML files that you can easily read and edit. You can
also easily copy these to another server, along with the other files that comprise your application.

ASP.NET Overview
Here are some point that gives the quick overview of ASP.NET.
ASP.NET provides services to allow the creation, deployment, and execution of Web Applications and
Web Services
Like ASP, ASP.NET is a server-side technology
Web Applications are built using Web Forms. ASP.NET comes with built-in Web Forms controls,
which are responsible for generating the user interface. They mirror typical HTML widgets like text
boxes or buttons. If these controls do not fit your needs, you are free to create your own user
controls.

3
Naveen Kumar Veligeti
Web Forms are designed to make building web-based applications as easy as building Visual Basic
applications

ASP.NET Architecture
ASP.NET is based on the fundamental architecture of .NET Framework. Visual studio provide a
uniform way to combine the various features of this Architecture.

Architecture is explained form bottom to top in the following discussion.
1. At the bottom of the Architecture is Common Language Runtime. NET Framework common
language runtime resides on top of the operating system services. The common language runtime
loads and executes code that targets the runtime. This code is therefore called managed code. The
runtime gives you, for example, the ability for cross-language integration.
2. .NET Framework provides a rich set of class libraries. These include base classes, like networking and
input/output classes, a data class library for data access, and classes for use by programming tools,
such as debugging services. All of them are brought together by the Services Framework, which sits
on top of the common language runtime.
3. ADO.NET is Microsoft’s ActiveX Data Object (ADO) model for the .NET Framework. ADO.NET is not
simply the migration of the popular ADO model to the managed environment but a completely new
paradigm for data access and manipulation.
ADO.NET is intended specifically for developing web applications. This is evident from its two major
design principles:
1. Disconnected Datasets—In ADO.NET, almost all data manipulation is done outside the context of an
open database connection.
2. Effortless Data Exchange with XML—Datasets can converse in the universal data format of the Web,
namely XML.
4. The 4th layer of the framework consists of the Windows application model and, in parallel, the Web
application model.
The Web application model-in the slide presented as ASP.NET-includes Web Forms and Web
Services.
ASP.NET comes with built-in Web Forms controls, which are responsible for generating the user
interface. They mirror typical HTML widgets like text boxes or buttons. If these controls do not fit

4
Naveen Kumar Veligeti
your needs, you are free to create your own user controls.
Web Services brings you a model to bind different applications over the Internet. This model is based
on existing infrastructure and applications and is therefore standard-based, simple, and adaptable.
Web Services are software solutions delivered via Internet to any device. Today, that means Web
browsers on computers, for the most part, but the device-agnostic design of .NET will eliminate this
limitation.
5. One of the obvious themes of .NET is unification and interoperability between various programming
languages. In order to achieve this; certain rules must be laid and all the languages must follow these
rules. In other words we can not have languages running around creating their own extensions and
their own fancy new data types. CLS is the collection of the rules and constraints that every language
(that seeks to achieve .NET compatibility) must follow.
6. The CLR and the .NET Frameworks in general, however, are designed in such a way that code written
in one language can not only seamlessly be used by another language. Hence ASP.NET can be
programmed in any of the .NET compatible language whether it is VB.NET, C#, Managed C++ or
JScript.NET.

Quick Start :To ASP.NET
After this short excursion with some background information on the .NET Framework, we will now
focus on ASP.NET.

File name extensions
Web applications written with ASP.NET will consist of many files with different file name extensions.
The most common are listed here. Native ASP.NET files by default have the extension .aspx (which is,
of course, an extension to .asp) or .ascx. Web Services normally have the extension .asmx.
Your file names containing the business logic will depend on the language you use. So, for example,
a C# file would have the extension .aspx.cs. You already learned about the configuration file
Web.Config.
Another one worth mentioning is the ASP.NET application file Global.asax - in the ASP world formerly
known as Global.asa. But now there is also a code behind file Global.asax.vb, for example, if the file
contains Visual Basic.NET code. Global.asax is an optional file that resides in the root directory of
your application, and it contains global logic for your application.

All of these are text files
All of these files are text files, and therefore human readable and writeable.

The easiest way to start
5
Naveen Kumar Veligeti
The easiest way to start with ASP.NET is to take a simple ASP page and change the file name
extension to .aspx.

Page Syntax
Here is quick introduction of syntax used in ASP.NET

Directives
You can use directives to specify optional settings used by the page compiler when processing
ASP.NET files. For each directive you can set different attributes. One example is the language
directive at the beginning of a page defining the default programming language.

Code Declaration Blocks
Code declaration blocks are lines of code enclosed in <script> tags. They contain the runat=server
attribute, which tells ASP.NET that these controls can be accessed on the server and on the client.
Optionally you can specify the language for the block. The code block itself consists of the definition
of member variables and methods.

Code Render Blocks
Render blocks contain inline code or inline expressions enclosed by the character sequences shown
here. The language used inside those blocks could be specified through a directive like the one
shown before.

HTML Control Syntax
You can declare several standard HTML elements as HTML server controls. Use the element as you
are familiar with in HTML and add the attribute runat=server. This causes the HTML element to be
treated as a server control. It is now programmatically accessible by using a unique ID. HTML server
controls must reside within a <form> section that also has the attribute runat=server.

Custom Control Syntax
There are two different kinds of custom controls. On the one hand there are the controls that ship
with .NET, and on the other hand you can create your own custom controls. Using custom server
controls is the best way to encapsulate common programmatic functionality.
Just specify elements as you did with HTML elements, but add a tag prefix, which is an alias for the
fully qualified namespace of the control. Again you must include the runat=server attribute. If you
want to get programmatic access to the control, just add an Id attribute.
You can include properties for each server control to characterize its behavior. For example, you can
set the maximum length of a TextBox. Those properties might have sub properties; you know this

6
Naveen Kumar Veligeti
principle from HTML. Now you have the ability to specify, for example, the size and type of the font
you use (font-size and font-type).
The last attribute is dedicated to event binding. This can be used to bind the control to a specific
event. If you implement your own method MyClick, this method will be executed when the
corresponding button is clicked if you use the server control event binding shown in the slide.

Data Binding Expression
You can create bindings between server controls and data sources. The data binding expression is
enclosed by the character sequences <%# and %>. The data-binding model provided by ASP.NET is
hierarchical. That means you can create bindings between server control properties and superior
data sources.

Server-side Object Tags
If you need to create an instance of an object on the server, use server-side object tags. When the
page is compiled, an instance of the specified object is created. To specify the object use the
identifier attribute. You can declare (and instantiate) .NET objects using class as the identifier, and
COM objects using either progid or classid.

Server-side Include Directives
With server-side include directives you can include raw contents of a file anywhere in your ASP.NET
file. Specify the type of the path to filename with the pathtype attribute. Use either File, when
specifying a relative path, or Virtual, when using a full virtual path.

Server-side Comments
To prevent server code from executing, use these character sequences to comment it out. You can
comment out full blocks - not just single lines.

First ASP.NET Program.
Now let us have our First ASP.NET program.
Let’s look at both the markup and the C# portions of a simple web forms application that generates
a movie line-up dynamically through software.

Markup Portion
Web form application part 1 -- SimpleWebForm.aspx

7
Naveen Kumar Veligeti

<% @Page Language="C#" Inherits="MoviePage" Src="SimpleWebForm.cs" %>
<html>
<body background="Texture.bmp">
<TITLE>Supermegacineplexadrome!</TITLE>
<H1 align="center"><FONT color="white" size="7">Welcome to
<br>Supermegacineplexadrome!</FONT></H1>
<P align="left"><FONT color="lime" size="5"><STRONG>
<U>Showtimes for <%WriteDate();%></U>
</STRONG></FONT></P>
<FONT size="5" color="yellow"><%WriteMovies();%></FONT>
</body>
</html>

And this is where the C# part of a web forms application comes in.

Web form application part 2 - SimpleWebForm.cs
using System;
using System.Web.UI;
using System.Web.UI.WebControls;
public class MoviePage:Page
{
protected void WriteDate()
{
Response.Write(DateTime.Now.ToString());
}
protected void WriteMovies()
{
Response.Write("<P>The Glass Ghost
Response.Write("<P>Untamed Harmony
"6:55 pm</P>");
Response.Write("<P>Forever Nowhere
Response.Write("<P>Without Justice
}
}

(R) 1:05 pm, 3:25 pm, 7:00 pm</P>");
(PG-13) 12:50 pm, 3:25 pm, " + <br>
(PG) 3:30 pm, 8:35 pm</P>");
(R) 12:45 pm, 6:45 pm</P>");

Execution Cycle :
Now let's see what’s happening on the server side. You will shortly understand how server controls fit
in.
A request for an .aspx file causes the ASP.NET runtime to parse the file for code that can be
compiled. It then generates a page class that instantiates and populates a tree of server control
instances. This page class represents the ASP.NET page.

8
Naveen Kumar Veligeti
Now an execution sequence is started in which, for example, the ASP.NET page walks its entire list of
controls, asking each one to render itself.
The controls paint themselves to the page. This means they make themselves visible by generating
HTML output to the browser client.

Execution Process
We need to have a look at what’s happening to your code in ASP.NET.

Compilation, when page is requested the first time
The first time a page is requested, the code is compiled. Compiling code in .NET means that a
compiler in a first step emits Microsoft intermediate language (MSIL) and produces metadata—if you
compile your source code to managed code. In a following step MSIL has to be converted to native
code.

Microsoft intermediate language (MSIL)
Microsoft intermediate language is code in an assembly language–like style. It is CPU independent
and therefore can be efficiently converted to native code.
The conversion in turn can be CPU-specific and optimized. The intermediate language provides a
hardware abstraction layer.
MSIL is executed by the common language runtime.

Common language runtime
The common language runtime contains just-in-time (JIT) compilers to convert the MSIL into native
code. This is done on the same computer architecture that the code should run on.
The runtime manages the code when it is compiled into MSIL—the code is therefore called managed
code.

ASP.NET Applications and Configuration
Overview
Like ASP, ASP.NET encapsulates its entities within a web application. A web application is an abstract
term for all the resources available within the confines of an IIS virtual directory. For example, a web
application may consist of one or more ASP.NET pages, assemblies, web services configuration files,

9
Naveen Kumar Veligeti
graphics, and more. In this section we explore two fundamental components of a web application,
namely global application files (Global.asax) and configuration files (Web.config).

Global.asax
Global.asax is a file used to declare application-level events and objects. Global.asax is the ASP.NET
extension of the ASP Global.asa file. Code to handle application events (such as the start and end of
an application) reside in Global.asax. Such event code cannot reside in the ASP.NET page or web
service code itself, since during the start or end of the application, its code has not yet been loaded
(or unloaded). Global.asax is also used to declare data that is available across different application
requests or across different browser sessions. This process is known as application and session state
management.
The Global.asax file must reside in the IIS virtual root. Remember that a virtual root can be thought of
as the container of a web application. Events and state specified in the global file are then applied to
all resources housed within the web application. If, for example, Global.asax defines a state
application variable, all .aspx files within the virtual root will be able to access the variable.
Like an ASP.NET page, the Global.asax file is compiled upon the arrival of the first request for any
resource in the application. The similarity continues when changes are made to the Global.asax file;
ASP.NET automatically notices the changes, recompiles the file, and directs all new requests to the
newest compilation. A Global.asax file is automatically created when you create a new web
application project in the VS.NET IDE.

Application Directives
Application directives are placed at the top of the Global.asax file and provide information used to
compile the global file. Three application directives are defined, namely Application, Assembly, and
Import. Each directive is applied with the following syntax:
<%@ appDirective appAttribute=Value ...%>

Web.config
In ASP, configuration settings for an application (such as session state) are stored in the IIS
metabase. There are two major disadvantages with this scheme. First, settings are not stored in a
human-readable manner but in a proprietary, binary format. Second, the settings are not easily
ported from one host machine to another.(It is difficult to transfer information from an IIS’s
metabase or Windows Registry to another machine, even if it has the same version of Windows.)
Web.config solves both of the aforementioned issues by storing configuration information as XML.
Unlike Registry or metabase entries, XML documents are human-readable and can be modified with
any text editor. Second, XML files are far more portable, involving a simple file transfer to switch
machines.

10
Naveen Kumar Veligeti
Unlike Global.asax, Web.config can reside in any directory, which may or may not be a virtual root.
The Web.config settings are then applied to all resources accessed within that directory, as well as its
subdirectories. One consequence is that an IIS instance may have many web.config files. Attributes
are applied in a hierarchical fashion. In other words, the web.config file at the lowest level directory is
used.
Since Web.config is based on XML, it is extensible and flexible for a wide variety of applications. It is
important, however, to note that the Web.config file is optional. A default Web.config file, used by all
ASP.NET application resources, can be found on the local machine at:
%winroot%Microsoft.NetFrameworkversionCONFIGmachine.config

Summary
ASP.NET is an evolution of Microsoft’s Active Server Page (ASP) technology. Using ASP.NET, you can
rapidly develop highly advanced web applications based on the .NET framework. Visual Studio Web
Form Designer, which allows the design of web applications in an intuitive, graphical method similar
to Visual Basic 6. ASP.NET ships with web controls wrapping each of the standard HTML controls, in
addition to several controls specific to .NET. One such example is validation controls, which intuitively
validate user input without the need for extensive client-side script.
In many respects, ASP.NET provides major improvements over ASP, and can definitely be considered
a viable alternative for rapidly developing web-based applications.

11

Mais conteúdo relacionado

Mais procurados

Industrial training seminar ppt on asp.net
Industrial training seminar ppt on asp.netIndustrial training seminar ppt on asp.net
Industrial training seminar ppt on asp.netPankaj Kushwaha
 
Creating Dynamic Web Application Using ASP.Net 3 5_MVP Alezandra Buencamino N...
Creating Dynamic Web Application Using ASP.Net 3 5_MVP Alezandra Buencamino N...Creating Dynamic Web Application Using ASP.Net 3 5_MVP Alezandra Buencamino N...
Creating Dynamic Web Application Using ASP.Net 3 5_MVP Alezandra Buencamino N...Quek Lilian
 
Intro To Asp Net And Web Forms
Intro To Asp Net And Web FormsIntro To Asp Net And Web Forms
Intro To Asp Net And Web FormsSAMIR BHOGAYTA
 
ASP.NET Tutorial - Presentation 1
ASP.NET Tutorial - Presentation 1ASP.NET Tutorial - Presentation 1
ASP.NET Tutorial - Presentation 1Kumar S
 
Microsoft .NET Development Platform Internationalization
Microsoft .NET Development Platform InternationalizationMicrosoft .NET Development Platform Internationalization
Microsoft .NET Development Platform InternationalizationRishi Kothari
 
Introduction to ASP.NET
Introduction to ASP.NETIntroduction to ASP.NET
Introduction to ASP.NETPeter Gfader
 
New Features of ASP.NET 4.0
New Features of ASP.NET 4.0New Features of ASP.NET 4.0
New Features of ASP.NET 4.0Buu Nguyen
 
Aspnet architecture
Aspnet architectureAspnet architecture
Aspnet architecturephantrithuc
 
01 asp.net session01
01 asp.net session0101 asp.net session01
01 asp.net session01Vivek chan
 
Bn1001 demo ppt advance dot net
Bn1001 demo ppt advance dot netBn1001 demo ppt advance dot net
Bn1001 demo ppt advance dot netconline training
 
Migrating To Visual Studio 2008 & .Net Framework 3.5
Migrating To Visual Studio 2008 & .Net Framework 3.5Migrating To Visual Studio 2008 & .Net Framework 3.5
Migrating To Visual Studio 2008 & .Net Framework 3.5Clint Edmonson
 
ASP.NET 5: What's the Big Deal
ASP.NET 5: What's the Big DealASP.NET 5: What's the Big Deal
ASP.NET 5: What's the Big DealJim Duffy
 
Flex Framework Presentation PPT
Flex Framework Presentation PPTFlex Framework Presentation PPT
Flex Framework Presentation PPTConstantin Stan
 
Salesforce Auckland Developer Meetup - May 2018 - Lightning Web Components
Salesforce Auckland Developer Meetup - May 2018 - Lightning Web Components Salesforce Auckland Developer Meetup - May 2018 - Lightning Web Components
Salesforce Auckland Developer Meetup - May 2018 - Lightning Web Components Ben Edwards
 
Spring Framework Tutorial | VirtualNuggets
Spring Framework Tutorial | VirtualNuggetsSpring Framework Tutorial | VirtualNuggets
Spring Framework Tutorial | VirtualNuggetsVirtual Nuggets
 

Mais procurados (20)

Industrial training seminar ppt on asp.net
Industrial training seminar ppt on asp.netIndustrial training seminar ppt on asp.net
Industrial training seminar ppt on asp.net
 
Creating Dynamic Web Application Using ASP.Net 3 5_MVP Alezandra Buencamino N...
Creating Dynamic Web Application Using ASP.Net 3 5_MVP Alezandra Buencamino N...Creating Dynamic Web Application Using ASP.Net 3 5_MVP Alezandra Buencamino N...
Creating Dynamic Web Application Using ASP.Net 3 5_MVP Alezandra Buencamino N...
 
Intro To Asp Net And Web Forms
Intro To Asp Net And Web FormsIntro To Asp Net And Web Forms
Intro To Asp Net And Web Forms
 
ASP.NET Tutorial - Presentation 1
ASP.NET Tutorial - Presentation 1ASP.NET Tutorial - Presentation 1
ASP.NET Tutorial - Presentation 1
 
Microsoft .NET Development Platform Internationalization
Microsoft .NET Development Platform InternationalizationMicrosoft .NET Development Platform Internationalization
Microsoft .NET Development Platform Internationalization
 
Introduction to ASP.NET
Introduction to ASP.NETIntroduction to ASP.NET
Introduction to ASP.NET
 
New Features of ASP.NET 4.0
New Features of ASP.NET 4.0New Features of ASP.NET 4.0
New Features of ASP.NET 4.0
 
Asp Architecture
Asp ArchitectureAsp Architecture
Asp Architecture
 
Aspnet architecture
Aspnet architectureAspnet architecture
Aspnet architecture
 
01 asp.net session01
01 asp.net session0101 asp.net session01
01 asp.net session01
 
Bn1001 demo ppt advance dot net
Bn1001 demo ppt advance dot netBn1001 demo ppt advance dot net
Bn1001 demo ppt advance dot net
 
Migrating To Visual Studio 2008 & .Net Framework 3.5
Migrating To Visual Studio 2008 & .Net Framework 3.5Migrating To Visual Studio 2008 & .Net Framework 3.5
Migrating To Visual Studio 2008 & .Net Framework 3.5
 
ASP.NET 5: What's the Big Deal
ASP.NET 5: What's the Big DealASP.NET 5: What's the Big Deal
ASP.NET 5: What's the Big Deal
 
Flex Framework Presentation PPT
Flex Framework Presentation PPTFlex Framework Presentation PPT
Flex Framework Presentation PPT
 
Salesforce Auckland Developer Meetup - May 2018 - Lightning Web Components
Salesforce Auckland Developer Meetup - May 2018 - Lightning Web Components Salesforce Auckland Developer Meetup - May 2018 - Lightning Web Components
Salesforce Auckland Developer Meetup - May 2018 - Lightning Web Components
 
Spring Framework Tutorial | VirtualNuggets
Spring Framework Tutorial | VirtualNuggetsSpring Framework Tutorial | VirtualNuggets
Spring Framework Tutorial | VirtualNuggets
 
George Jordanov CV
George Jordanov CVGeorge Jordanov CV
George Jordanov CV
 
MVC - Introduction
MVC - IntroductionMVC - Introduction
MVC - Introduction
 
Oracle Apex Overview
Oracle Apex OverviewOracle Apex Overview
Oracle Apex Overview
 
ASP.NET OVERVIEW
ASP.NET OVERVIEWASP.NET OVERVIEW
ASP.NET OVERVIEW
 

Semelhante a Beginners introduction to asp.net

Online furniture management system
Online furniture management systemOnline furniture management system
Online furniture management systemYesu Raj
 
Top 10 - ASP.NET Interview Questions And Answers 2023.pdf
Top 10 -  ASP.NET Interview Questions And Answers 2023.pdfTop 10 -  ASP.NET Interview Questions And Answers 2023.pdf
Top 10 - ASP.NET Interview Questions And Answers 2023.pdfRuddarpratap
 
Aspnet2.0 Introduction
Aspnet2.0 IntroductionAspnet2.0 Introduction
Aspnet2.0 IntroductionChanHan Hy
 
Benefits of Using ASP.NET For Web Development for Businesses In 2023
Benefits of Using ASP.NET For Web Development for Businesses In 2023Benefits of Using ASP.NET For Web Development for Businesses In 2023
Benefits of Using ASP.NET For Web Development for Businesses In 2023CMARIX TechnoLabs
 
Web Development with ASP.NET: Taking Control of the Digital World
Web Development with ASP.NET: Taking Control  of the Digital WorldWeb Development with ASP.NET: Taking Control  of the Digital World
Web Development with ASP.NET: Taking Control of the Digital Worldcompany
 
Top 8 Reasons ASP.NET Core is the Best Framework for Web Application Developm...
Top 8 Reasons ASP.NET Core is the Best Framework for Web Application Developm...Top 8 Reasons ASP.NET Core is the Best Framework for Web Application Developm...
Top 8 Reasons ASP.NET Core is the Best Framework for Web Application Developm...WDP Technologies
 
What is ASP.NET and Why do we need it?
What is ASP.NET and Why do we need it?What is ASP.NET and Why do we need it?
What is ASP.NET and Why do we need it?Natural Group
 
ASP.NET Presentation
ASP.NET PresentationASP.NET Presentation
ASP.NET PresentationRasel Khan
 
Unit - 1: ASP.NET Basic
Unit - 1:  ASP.NET BasicUnit - 1:  ASP.NET Basic
Unit - 1: ASP.NET BasicKALIDHASANR
 
Difference between .net and asp.net all you need to know
Difference between .net and asp.net  all you need to knowDifference between .net and asp.net  all you need to know
Difference between .net and asp.net all you need to knowsophiaaaddison
 
Asp.net architecture
Asp.net architectureAsp.net architecture
Asp.net architectureIblesoft
 
Asp Net Vs Vue JS Which One You Should Choose for Development.pdf
Asp Net Vs Vue JS Which One You Should Choose for Development.pdfAsp Net Vs Vue JS Which One You Should Choose for Development.pdf
Asp Net Vs Vue JS Which One You Should Choose for Development.pdfIntegrated IT Solutions
 

Semelhante a Beginners introduction to asp.net (20)

Online furniture management system
Online furniture management systemOnline furniture management system
Online furniture management system
 
Top 10 - ASP.NET Interview Questions And Answers 2023.pdf
Top 10 -  ASP.NET Interview Questions And Answers 2023.pdfTop 10 -  ASP.NET Interview Questions And Answers 2023.pdf
Top 10 - ASP.NET Interview Questions And Answers 2023.pdf
 
Aspnet2.0 Introduction
Aspnet2.0 IntroductionAspnet2.0 Introduction
Aspnet2.0 Introduction
 
Asp.netrole
Asp.netroleAsp.netrole
Asp.netrole
 
Benefits of Using ASP.NET For Web Development for Businesses In 2023
Benefits of Using ASP.NET For Web Development for Businesses In 2023Benefits of Using ASP.NET For Web Development for Businesses In 2023
Benefits of Using ASP.NET For Web Development for Businesses In 2023
 
Asp-net
 Asp-net Asp-net
Asp-net
 
Asp.Net Tutorials
Asp.Net TutorialsAsp.Net Tutorials
Asp.Net Tutorials
 
Web Development with ASP.NET: Taking Control of the Digital World
Web Development with ASP.NET: Taking Control  of the Digital WorldWeb Development with ASP.NET: Taking Control  of the Digital World
Web Development with ASP.NET: Taking Control of the Digital World
 
Top 8 Reasons ASP.NET Core is the Best Framework for Web Application Developm...
Top 8 Reasons ASP.NET Core is the Best Framework for Web Application Developm...Top 8 Reasons ASP.NET Core is the Best Framework for Web Application Developm...
Top 8 Reasons ASP.NET Core is the Best Framework for Web Application Developm...
 
Asp.net Vs Vue.js.pdf
Asp.net Vs Vue.js.pdfAsp.net Vs Vue.js.pdf
Asp.net Vs Vue.js.pdf
 
What is ASP.NET and Why do we need it?
What is ASP.NET and Why do we need it?What is ASP.NET and Why do we need it?
What is ASP.NET and Why do we need it?
 
ASP.NET Presentation
ASP.NET PresentationASP.NET Presentation
ASP.NET Presentation
 
Unit - 1: ASP.NET Basic
Unit - 1:  ASP.NET BasicUnit - 1:  ASP.NET Basic
Unit - 1: ASP.NET Basic
 
Difference between .net and asp.net all you need to know
Difference between .net and asp.net  all you need to knowDifference between .net and asp.net  all you need to know
Difference between .net and asp.net all you need to know
 
Asp.net architecture
Asp.net architectureAsp.net architecture
Asp.net architecture
 
Asp Net Vs Vue JS Which One You Should Choose for Development.pdf
Asp Net Vs Vue JS Which One You Should Choose for Development.pdfAsp Net Vs Vue JS Which One You Should Choose for Development.pdf
Asp Net Vs Vue JS Which One You Should Choose for Development.pdf
 
Asp.net Web Development.pdf
Asp.net Web Development.pdfAsp.net Web Development.pdf
Asp.net Web Development.pdf
 
Web tech
Web techWeb tech
Web tech
 
Web tech
Web techWeb tech
Web tech
 
Web tech
Web techWeb tech
Web tech
 

Mais de Naveen Kumar Veligeti

.Net framework components by naveen kumar veligeti
.Net framework components by naveen kumar veligeti.Net framework components by naveen kumar veligeti
.Net framework components by naveen kumar veligetiNaveen Kumar Veligeti
 
Basic CSS concepts by naveen kumar veligeti
Basic CSS concepts by naveen kumar veligetiBasic CSS concepts by naveen kumar veligeti
Basic CSS concepts by naveen kumar veligetiNaveen Kumar Veligeti
 
Php forms and validations by naveen kumar veligeti
Php forms and validations by naveen kumar veligetiPhp forms and validations by naveen kumar veligeti
Php forms and validations by naveen kumar veligetiNaveen Kumar Veligeti
 
Why use .net by naveen kumar veligeti
Why use .net by naveen kumar veligetiWhy use .net by naveen kumar veligeti
Why use .net by naveen kumar veligetiNaveen Kumar Veligeti
 
Types of sql commands by naveen kumar veligeti
Types of sql commands by naveen kumar veligetiTypes of sql commands by naveen kumar veligeti
Types of sql commands by naveen kumar veligetiNaveen Kumar Veligeti
 
Sql data types for various d bs by naveen kumar veligeti
Sql data types for various d bs by naveen kumar veligetiSql data types for various d bs by naveen kumar veligeti
Sql data types for various d bs by naveen kumar veligetiNaveen Kumar Veligeti
 
.Net framework by naveen kumar veligeti
.Net framework by naveen kumar veligeti.Net framework by naveen kumar veligeti
.Net framework by naveen kumar veligetiNaveen Kumar Veligeti
 

Mais de Naveen Kumar Veligeti (8)

.Net framework components by naveen kumar veligeti
.Net framework components by naveen kumar veligeti.Net framework components by naveen kumar veligeti
.Net framework components by naveen kumar veligeti
 
Basic CSS concepts by naveen kumar veligeti
Basic CSS concepts by naveen kumar veligetiBasic CSS concepts by naveen kumar veligeti
Basic CSS concepts by naveen kumar veligeti
 
Php forms and validations by naveen kumar veligeti
Php forms and validations by naveen kumar veligetiPhp forms and validations by naveen kumar veligeti
Php forms and validations by naveen kumar veligeti
 
Why use .net by naveen kumar veligeti
Why use .net by naveen kumar veligetiWhy use .net by naveen kumar veligeti
Why use .net by naveen kumar veligeti
 
Types of sql commands by naveen kumar veligeti
Types of sql commands by naveen kumar veligetiTypes of sql commands by naveen kumar veligeti
Types of sql commands by naveen kumar veligeti
 
Sql data types for various d bs by naveen kumar veligeti
Sql data types for various d bs by naveen kumar veligetiSql data types for various d bs by naveen kumar veligeti
Sql data types for various d bs by naveen kumar veligeti
 
Clauses in sql server
Clauses in sql serverClauses in sql server
Clauses in sql server
 
.Net framework by naveen kumar veligeti
.Net framework by naveen kumar veligeti.Net framework by naveen kumar veligeti
.Net framework by naveen kumar veligeti
 

Último

Judging the Relevance and worth of ideas part 2.pptx
Judging the Relevance  and worth of ideas part 2.pptxJudging the Relevance  and worth of ideas part 2.pptx
Judging the Relevance and worth of ideas part 2.pptxSherlyMaeNeri
 
Keynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designKeynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designMIPLM
 
Barangay Council for the Protection of Children (BCPC) Orientation.pptx
Barangay Council for the Protection of Children (BCPC) Orientation.pptxBarangay Council for the Protection of Children (BCPC) Orientation.pptx
Barangay Council for the Protection of Children (BCPC) Orientation.pptxCarlos105
 
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17Celine George
 
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptxMULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptxAnupkumar Sharma
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...Postal Advocate Inc.
 
Gas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptxGas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptxDr.Ibrahim Hassaan
 
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptxINTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptxHumphrey A Beña
 
Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Celine George
 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxthorishapillay1
 
ACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdfACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdfSpandanaRallapalli
 
Grade 9 Q4-MELC1-Active and Passive Voice.pptx
Grade 9 Q4-MELC1-Active and Passive Voice.pptxGrade 9 Q4-MELC1-Active and Passive Voice.pptx
Grade 9 Q4-MELC1-Active and Passive Voice.pptxChelloAnnAsuncion2
 
DATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginnersDATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginnersSabitha Banu
 
Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...Jisc
 
ENGLISH6-Q4-W3.pptxqurter our high choom
ENGLISH6-Q4-W3.pptxqurter our high choomENGLISH6-Q4-W3.pptxqurter our high choom
ENGLISH6-Q4-W3.pptxqurter our high choomnelietumpap1
 

Último (20)

Judging the Relevance and worth of ideas part 2.pptx
Judging the Relevance  and worth of ideas part 2.pptxJudging the Relevance  and worth of ideas part 2.pptx
Judging the Relevance and worth of ideas part 2.pptx
 
OS-operating systems- ch04 (Threads) ...
OS-operating systems- ch04 (Threads) ...OS-operating systems- ch04 (Threads) ...
OS-operating systems- ch04 (Threads) ...
 
Keynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designKeynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-design
 
Barangay Council for the Protection of Children (BCPC) Orientation.pptx
Barangay Council for the Protection of Children (BCPC) Orientation.pptxBarangay Council for the Protection of Children (BCPC) Orientation.pptx
Barangay Council for the Protection of Children (BCPC) Orientation.pptx
 
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
 
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptxMULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
 
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
 
Gas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptxGas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptx
 
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptxINTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
 
FINALS_OF_LEFT_ON_C'N_EL_DORADO_2024.pptx
FINALS_OF_LEFT_ON_C'N_EL_DORADO_2024.pptxFINALS_OF_LEFT_ON_C'N_EL_DORADO_2024.pptx
FINALS_OF_LEFT_ON_C'N_EL_DORADO_2024.pptx
 
Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17
 
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptx
 
LEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptx
LEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptxLEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptx
LEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptx
 
ACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdfACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdf
 
Grade 9 Q4-MELC1-Active and Passive Voice.pptx
Grade 9 Q4-MELC1-Active and Passive Voice.pptxGrade 9 Q4-MELC1-Active and Passive Voice.pptx
Grade 9 Q4-MELC1-Active and Passive Voice.pptx
 
DATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginnersDATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginners
 
Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...
 
ENGLISH6-Q4-W3.pptxqurter our high choom
ENGLISH6-Q4-W3.pptxqurter our high choomENGLISH6-Q4-W3.pptxqurter our high choom
ENGLISH6-Q4-W3.pptxqurter our high choom
 

Beginners introduction to asp.net

  • 1. Naveen Kumar Veligeti Beginners Introduction to ASP.NET Introduction I have seen many tutorials on ASP.NET but most of them starts with coding and writing your first ASP.NET Program. But here I has written this tutorial for explaining why there is a need for ASP.NET when classy ASP is working fine and what are the underlying technology behind ASP.NET, What programming model ASP.NET Provides to programmers. Now let us get started. ASP.NET is the new offering for Web developers from the Microsoft .It is not simply the nextgeneration of ASP; in fact, it is a completely re-engineered and enhanced technology that offers much, much more than traditional ASP and can increase productivity significantly. Because it has evolved from ASP, ASP.NET looks very similar to its predecessor—but only at first sight. Some items look very familiar, and they remind us of ASP. But concepts like Web Forms, Web Services, or Server Controls gives ASP.NET the power to build real Web applications. Looking Back : Active Server Pages (ASP) Microsoft Active Server Pages (ASP) is a server-side scripting technology. ASP is a technology that Microsoft created to ease the development of interactive Web applications. With ASP you can use client-side scripts as well as server-side scripts. Maybe you want to validate user input or access a database. ASP provides solutions for transaction processing and managing session state. Asp is one of the most successful language used in web development. Problems with Traditional ASP There are many problems with ASP if you think of needs for Today's powerful Web applications. 1. Interpreted and Loosely-Typed Code ASP scripting code is usually written in languages such as JScript or VBScript. The script-execution engine that Active Server Pages relies on interprets code line by line, every time the page is called. In addition, although variables are supported, they are all loosely typed as variants and bound to particular types only when the code is run. Both these factors impede performance, and late binding of types makes it harder to catch errors when you are writing code. 2. Mixes layout (HTML) and logic (scripting code) ASP files frequently combine script code with HTML. This results in ASP scripts that are lengthy, difficult to read, and switch frequently between code and HTML. The interspersion of HTML with ASP 1
  • 2. Naveen Kumar Veligeti code is particularly problematic for larger web applications, where content must be kept separate from business logic. 3. Limited Development and Debugging Tools Microsoft Visual InterDev, Macromedia Visual UltraDev, and other tools have attempted to increase the productivity of ASP programmers by providing graphical development environments. However, these tools never achieved the ease of use or the level of acceptance achieved by Microsoft Windows application development tools, such as Visual Basic or Microsoft Access. ASP developers still rely heavily or exclusively on Notepad. Debugging is an unavoidable part of any software development process, and the debugging tools for ASP have been minimal. Most ASP programmers resort to embedding temporary Response. Write statements in their code to trace the progress of its execution. 4. No real state management Session state is only maintained if the client browser supports cookies. Session state information can only be held by using the ASP Session object. And you have to implement additional code if you, for example, want to identify a user. 5. Update files only when server is down If your Web application makes use of components, copying new files to your application should only be done when the Web server is stopped. Otherwise it is like pulling the rug from under your application's feet, because the components may be in use (and locked) and must be registered. 6. Obscure Configuration Settings The configuration information for an ASP web application (such as session state and server timeouts) is stored in the IIS metabase. Because the metabase is stored in a proprietary format, it can only be modified on the server machine with utilities such as the Internet Service Manager. With limited support for programmatically manipulating or extracting these settings, it is often an arduous task to port an ASP application from one server to another. Introducing ASP.NET ASP.NET was developed in direct response to the problems that developers had with classic ASP. Since ASP is in such wide use, however, Microsoft ensured that ASP scripts execute without modification on a machine with the .NET Framework (the ASP engine, ASP.DLL, is not modified when installing the .NET Framework). Thus, IIS can house both ASP and ASP.NET scripts on the same machine. Advantages of ASP.NET 1. Separation of Code from HTML To make a clean sweep, with ASP.NET you have the ability to completely separate layout and business logic. This makes it much easier for teams of programmers and designers to collaborate 2
  • 3. Naveen Kumar Veligeti efficiently. This makes it much easier for teams of programmers and designers to collaborate efficiently. 2. Support for compiled languages developer can use VB.NET and access features such as strong typing and object-oriented programming. Using compiled languages also means that ASP.NET pages do not suffer the performance penalties associated with interpreted code. ASP.NET pages are precompiled to bytecode and Just In Time (JIT) compiled when first requested. Subsequent requests are directed to the fully compiled code, which is cached until the source changes. 3. Use services provided by the .NET Framework The .NET Framework provides class libraries that can be used by your application. Some of the key classes help you with input/output, access to operating system services, data access, or even debugging. We will go into more detail on some of them in this module. 4. Graphical Development Environment Visual Studio .NET provides a very rich development environment for Web developers. You can drag and drop controls and set properties the way you do in Visual Basic 6. And you have full IntelliSense support, not only for your code, but also for HTML and XML. 5. State management To refer to the problems mentioned before, ASP.NET provides solutions for session and application state management. State information can, for example, be kept in memory or stored in a database. It can be shared across Web farms, and state information can be recovered, even if the server fails or the connection breaks down. 6. Update files while the server is running! Components of your application can be updated while the server is online and clients are connected. The Framework will use the new files as soon as they are copied to the application. Removed or old files that are still in use are kept in memory until the clients have finished. 7. XML-Based Configuration Files Configuration settings in ASP.NET are stored in XML files that you can easily read and edit. You can also easily copy these to another server, along with the other files that comprise your application. ASP.NET Overview Here are some point that gives the quick overview of ASP.NET. ASP.NET provides services to allow the creation, deployment, and execution of Web Applications and Web Services Like ASP, ASP.NET is a server-side technology Web Applications are built using Web Forms. ASP.NET comes with built-in Web Forms controls, which are responsible for generating the user interface. They mirror typical HTML widgets like text boxes or buttons. If these controls do not fit your needs, you are free to create your own user controls. 3
  • 4. Naveen Kumar Veligeti Web Forms are designed to make building web-based applications as easy as building Visual Basic applications ASP.NET Architecture ASP.NET is based on the fundamental architecture of .NET Framework. Visual studio provide a uniform way to combine the various features of this Architecture. Architecture is explained form bottom to top in the following discussion. 1. At the bottom of the Architecture is Common Language Runtime. NET Framework common language runtime resides on top of the operating system services. The common language runtime loads and executes code that targets the runtime. This code is therefore called managed code. The runtime gives you, for example, the ability for cross-language integration. 2. .NET Framework provides a rich set of class libraries. These include base classes, like networking and input/output classes, a data class library for data access, and classes for use by programming tools, such as debugging services. All of them are brought together by the Services Framework, which sits on top of the common language runtime. 3. ADO.NET is Microsoft’s ActiveX Data Object (ADO) model for the .NET Framework. ADO.NET is not simply the migration of the popular ADO model to the managed environment but a completely new paradigm for data access and manipulation. ADO.NET is intended specifically for developing web applications. This is evident from its two major design principles: 1. Disconnected Datasets—In ADO.NET, almost all data manipulation is done outside the context of an open database connection. 2. Effortless Data Exchange with XML—Datasets can converse in the universal data format of the Web, namely XML. 4. The 4th layer of the framework consists of the Windows application model and, in parallel, the Web application model. The Web application model-in the slide presented as ASP.NET-includes Web Forms and Web Services. ASP.NET comes with built-in Web Forms controls, which are responsible for generating the user interface. They mirror typical HTML widgets like text boxes or buttons. If these controls do not fit 4
  • 5. Naveen Kumar Veligeti your needs, you are free to create your own user controls. Web Services brings you a model to bind different applications over the Internet. This model is based on existing infrastructure and applications and is therefore standard-based, simple, and adaptable. Web Services are software solutions delivered via Internet to any device. Today, that means Web browsers on computers, for the most part, but the device-agnostic design of .NET will eliminate this limitation. 5. One of the obvious themes of .NET is unification and interoperability between various programming languages. In order to achieve this; certain rules must be laid and all the languages must follow these rules. In other words we can not have languages running around creating their own extensions and their own fancy new data types. CLS is the collection of the rules and constraints that every language (that seeks to achieve .NET compatibility) must follow. 6. The CLR and the .NET Frameworks in general, however, are designed in such a way that code written in one language can not only seamlessly be used by another language. Hence ASP.NET can be programmed in any of the .NET compatible language whether it is VB.NET, C#, Managed C++ or JScript.NET. Quick Start :To ASP.NET After this short excursion with some background information on the .NET Framework, we will now focus on ASP.NET. File name extensions Web applications written with ASP.NET will consist of many files with different file name extensions. The most common are listed here. Native ASP.NET files by default have the extension .aspx (which is, of course, an extension to .asp) or .ascx. Web Services normally have the extension .asmx. Your file names containing the business logic will depend on the language you use. So, for example, a C# file would have the extension .aspx.cs. You already learned about the configuration file Web.Config. Another one worth mentioning is the ASP.NET application file Global.asax - in the ASP world formerly known as Global.asa. But now there is also a code behind file Global.asax.vb, for example, if the file contains Visual Basic.NET code. Global.asax is an optional file that resides in the root directory of your application, and it contains global logic for your application. All of these are text files All of these files are text files, and therefore human readable and writeable. The easiest way to start 5
  • 6. Naveen Kumar Veligeti The easiest way to start with ASP.NET is to take a simple ASP page and change the file name extension to .aspx. Page Syntax Here is quick introduction of syntax used in ASP.NET Directives You can use directives to specify optional settings used by the page compiler when processing ASP.NET files. For each directive you can set different attributes. One example is the language directive at the beginning of a page defining the default programming language. Code Declaration Blocks Code declaration blocks are lines of code enclosed in <script> tags. They contain the runat=server attribute, which tells ASP.NET that these controls can be accessed on the server and on the client. Optionally you can specify the language for the block. The code block itself consists of the definition of member variables and methods. Code Render Blocks Render blocks contain inline code or inline expressions enclosed by the character sequences shown here. The language used inside those blocks could be specified through a directive like the one shown before. HTML Control Syntax You can declare several standard HTML elements as HTML server controls. Use the element as you are familiar with in HTML and add the attribute runat=server. This causes the HTML element to be treated as a server control. It is now programmatically accessible by using a unique ID. HTML server controls must reside within a <form> section that also has the attribute runat=server. Custom Control Syntax There are two different kinds of custom controls. On the one hand there are the controls that ship with .NET, and on the other hand you can create your own custom controls. Using custom server controls is the best way to encapsulate common programmatic functionality. Just specify elements as you did with HTML elements, but add a tag prefix, which is an alias for the fully qualified namespace of the control. Again you must include the runat=server attribute. If you want to get programmatic access to the control, just add an Id attribute. You can include properties for each server control to characterize its behavior. For example, you can set the maximum length of a TextBox. Those properties might have sub properties; you know this 6
  • 7. Naveen Kumar Veligeti principle from HTML. Now you have the ability to specify, for example, the size and type of the font you use (font-size and font-type). The last attribute is dedicated to event binding. This can be used to bind the control to a specific event. If you implement your own method MyClick, this method will be executed when the corresponding button is clicked if you use the server control event binding shown in the slide. Data Binding Expression You can create bindings between server controls and data sources. The data binding expression is enclosed by the character sequences <%# and %>. The data-binding model provided by ASP.NET is hierarchical. That means you can create bindings between server control properties and superior data sources. Server-side Object Tags If you need to create an instance of an object on the server, use server-side object tags. When the page is compiled, an instance of the specified object is created. To specify the object use the identifier attribute. You can declare (and instantiate) .NET objects using class as the identifier, and COM objects using either progid or classid. Server-side Include Directives With server-side include directives you can include raw contents of a file anywhere in your ASP.NET file. Specify the type of the path to filename with the pathtype attribute. Use either File, when specifying a relative path, or Virtual, when using a full virtual path. Server-side Comments To prevent server code from executing, use these character sequences to comment it out. You can comment out full blocks - not just single lines. First ASP.NET Program. Now let us have our First ASP.NET program. Let’s look at both the markup and the C# portions of a simple web forms application that generates a movie line-up dynamically through software. Markup Portion Web form application part 1 -- SimpleWebForm.aspx 7
  • 8. Naveen Kumar Veligeti <% @Page Language="C#" Inherits="MoviePage" Src="SimpleWebForm.cs" %> <html> <body background="Texture.bmp"> <TITLE>Supermegacineplexadrome!</TITLE> <H1 align="center"><FONT color="white" size="7">Welcome to <br>Supermegacineplexadrome!</FONT></H1> <P align="left"><FONT color="lime" size="5"><STRONG> <U>Showtimes for <%WriteDate();%></U> </STRONG></FONT></P> <FONT size="5" color="yellow"><%WriteMovies();%></FONT> </body> </html> And this is where the C# part of a web forms application comes in. Web form application part 2 - SimpleWebForm.cs using System; using System.Web.UI; using System.Web.UI.WebControls; public class MoviePage:Page { protected void WriteDate() { Response.Write(DateTime.Now.ToString()); } protected void WriteMovies() { Response.Write("<P>The Glass Ghost Response.Write("<P>Untamed Harmony "6:55 pm</P>"); Response.Write("<P>Forever Nowhere Response.Write("<P>Without Justice } } (R) 1:05 pm, 3:25 pm, 7:00 pm</P>"); (PG-13) 12:50 pm, 3:25 pm, " + <br> (PG) 3:30 pm, 8:35 pm</P>"); (R) 12:45 pm, 6:45 pm</P>"); Execution Cycle : Now let's see what’s happening on the server side. You will shortly understand how server controls fit in. A request for an .aspx file causes the ASP.NET runtime to parse the file for code that can be compiled. It then generates a page class that instantiates and populates a tree of server control instances. This page class represents the ASP.NET page. 8
  • 9. Naveen Kumar Veligeti Now an execution sequence is started in which, for example, the ASP.NET page walks its entire list of controls, asking each one to render itself. The controls paint themselves to the page. This means they make themselves visible by generating HTML output to the browser client. Execution Process We need to have a look at what’s happening to your code in ASP.NET. Compilation, when page is requested the first time The first time a page is requested, the code is compiled. Compiling code in .NET means that a compiler in a first step emits Microsoft intermediate language (MSIL) and produces metadata—if you compile your source code to managed code. In a following step MSIL has to be converted to native code. Microsoft intermediate language (MSIL) Microsoft intermediate language is code in an assembly language–like style. It is CPU independent and therefore can be efficiently converted to native code. The conversion in turn can be CPU-specific and optimized. The intermediate language provides a hardware abstraction layer. MSIL is executed by the common language runtime. Common language runtime The common language runtime contains just-in-time (JIT) compilers to convert the MSIL into native code. This is done on the same computer architecture that the code should run on. The runtime manages the code when it is compiled into MSIL—the code is therefore called managed code. ASP.NET Applications and Configuration Overview Like ASP, ASP.NET encapsulates its entities within a web application. A web application is an abstract term for all the resources available within the confines of an IIS virtual directory. For example, a web application may consist of one or more ASP.NET pages, assemblies, web services configuration files, 9
  • 10. Naveen Kumar Veligeti graphics, and more. In this section we explore two fundamental components of a web application, namely global application files (Global.asax) and configuration files (Web.config). Global.asax Global.asax is a file used to declare application-level events and objects. Global.asax is the ASP.NET extension of the ASP Global.asa file. Code to handle application events (such as the start and end of an application) reside in Global.asax. Such event code cannot reside in the ASP.NET page or web service code itself, since during the start or end of the application, its code has not yet been loaded (or unloaded). Global.asax is also used to declare data that is available across different application requests or across different browser sessions. This process is known as application and session state management. The Global.asax file must reside in the IIS virtual root. Remember that a virtual root can be thought of as the container of a web application. Events and state specified in the global file are then applied to all resources housed within the web application. If, for example, Global.asax defines a state application variable, all .aspx files within the virtual root will be able to access the variable. Like an ASP.NET page, the Global.asax file is compiled upon the arrival of the first request for any resource in the application. The similarity continues when changes are made to the Global.asax file; ASP.NET automatically notices the changes, recompiles the file, and directs all new requests to the newest compilation. A Global.asax file is automatically created when you create a new web application project in the VS.NET IDE. Application Directives Application directives are placed at the top of the Global.asax file and provide information used to compile the global file. Three application directives are defined, namely Application, Assembly, and Import. Each directive is applied with the following syntax: <%@ appDirective appAttribute=Value ...%> Web.config In ASP, configuration settings for an application (such as session state) are stored in the IIS metabase. There are two major disadvantages with this scheme. First, settings are not stored in a human-readable manner but in a proprietary, binary format. Second, the settings are not easily ported from one host machine to another.(It is difficult to transfer information from an IIS’s metabase or Windows Registry to another machine, even if it has the same version of Windows.) Web.config solves both of the aforementioned issues by storing configuration information as XML. Unlike Registry or metabase entries, XML documents are human-readable and can be modified with any text editor. Second, XML files are far more portable, involving a simple file transfer to switch machines. 10
  • 11. Naveen Kumar Veligeti Unlike Global.asax, Web.config can reside in any directory, which may or may not be a virtual root. The Web.config settings are then applied to all resources accessed within that directory, as well as its subdirectories. One consequence is that an IIS instance may have many web.config files. Attributes are applied in a hierarchical fashion. In other words, the web.config file at the lowest level directory is used. Since Web.config is based on XML, it is extensible and flexible for a wide variety of applications. It is important, however, to note that the Web.config file is optional. A default Web.config file, used by all ASP.NET application resources, can be found on the local machine at: %winroot%Microsoft.NetFrameworkversionCONFIGmachine.config Summary ASP.NET is an evolution of Microsoft’s Active Server Page (ASP) technology. Using ASP.NET, you can rapidly develop highly advanced web applications based on the .NET framework. Visual Studio Web Form Designer, which allows the design of web applications in an intuitive, graphical method similar to Visual Basic 6. ASP.NET ships with web controls wrapping each of the standard HTML controls, in addition to several controls specific to .NET. One such example is validation controls, which intuitively validate user input without the need for extensive client-side script. In many respects, ASP.NET provides major improvements over ASP, and can definitely be considered a viable alternative for rapidly developing web-based applications. 11