Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
174 views

Unit-1 Introduction To ASP - NET Web Programming - IDE-Attachment-1 - 02-04-2021-08-40-01

This document provides an introduction to ASP.Net web programming. It discusses basics of ASP.Net including its benefits like easier object-oriented programming and database operations. Key features are outlined such as support for multiple tools and languages. Differences between ASP.Net and classic ASP are highlighted relating to object models, tools, and validation controls. Finally, the differences between a web page/site and web application are defined based on interactivity, language usage, and compilation needs.

Uploaded by

Manav
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
174 views

Unit-1 Introduction To ASP - NET Web Programming - IDE-Attachment-1 - 02-04-2021-08-40-01

This document provides an introduction to ASP.Net web programming. It discusses basics of ASP.Net including its benefits like easier object-oriented programming and database operations. Key features are outlined such as support for multiple tools and languages. Differences between ASP.Net and classic ASP are highlighted relating to object models, tools, and validation controls. Finally, the differences between a web page/site and web application are defined based on interactivity, language usage, and compilation needs.

Uploaded by

Manav
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 35

Advance Web Technology (AWT)

GTU # 3360706

Unit-1
Introduction to
ASP.Net Web
Programming & IDE
Prof. Nima H Patel
Computer Engineering Department
Darshan Institute of Engineering & Technology for Diploma Studies, Rajkot
nima.patel@darshan.ac.in
Introduction of ASP.Net
Section - 1
Basics of ASP.Net
Built on CLR (Common
Active Server Page
Language Runtime)

First Release: ASP.Net It is a technology.


January 2002,
Version 1.0

Latest Release: Used to develop web pages,


April 2019, web services and web
Version 4.8 applications.

#3360706 (AWT)  Unit 1 – Introduction to ASP.Net Web Programming &


Prof. Nima H Patel 3
Benefits of ASP.Net
Easier OOP Language Supports OOP concepts i.e. class, objects, inheritance etc.

Quick Drag & Drop Control Just drag any tool and drop as per your requirement

Code Separation Different pages for source code and event code

Easier Database Operations Creation, insertion, updation, deletion of database

Version Compatibility Supports previous version’s projects too

High Security Provide validation controls to secure data

High Integrated IDE Rich set of tools available for project development

#3360706 (AWT)  Unit 1 – Introduction to ASP.Net Web Programming &


Prof. Nima H Patel 4
Features of ASP.Net
 ASP.NET supports very large amount ASP.NET supports a very high range of tools
 of
 ASP.NET is a technology which can be
Simplifiedclass
database Programming which can be easily implemented.
and it also provide easy Powerful Database
Model implemented using any Support
.NET language such
deployment of the connectivity with the
as C#.NET or VB.NET.
application.
 With the help of ASP.NET, web services are
useful for the communication of protocols.  Ability to run multiple version of an

Features
Side services
 Web by side Execution
can be used by other Web Services
application or component on the same
application too. computer.

 In other languages, to validate any control,


of  ASP.NET has rich web server controls which
have to write many
Server-side lines of codes while in
Controls
ASP.NET is becomes easy and simple.
ASP.Net are capable to Simplified
identify client’s browser and
Form Validation
can render the HTML tags accordingly.

 CLR provides facility to work with many  Architecture of the ASP.NET is designed in
different programming languages, so
Performance order to increase the performance
Simplified of the
Deployment
deployment becomes easy and fast. application.

Rich Toolbox Support

#3360706 (AWT)  Unit 1 – Introduction to ASP.Net Web Programming &


Prof. Nima H Patel 5
Difference between ASP.NET and Classic ASP
Sr.
ASP.NET Classic ASP
No.
1 ASP.NET is fully featured OOP (Object Oriented Classic ASP is partially featured OOP (Object Oriented
Programming Language). Programming Language).

2 ASP.NET has built-in support of XML (eXtensible Markup Classic ASP has no built-in support of XML (eXtensible
Language). So, data exchange is easy. Markup Language). So, data exchange is not easy.

3 ASP.NET provides various tools and compiler Classic ASP provides less tools and compiler.

4 In ASP.NET, debugging is easy. In Classic ASP, debugging is difficult.

5 ASP.NET provides C# or VB.Net as server side Classic ASP provides Visual Basic Scripting or Java
programming language . Scripting for scripting.
6 Error Handling is very good. Error Handling is very poor.

7 ASP.NET has 3-tier architecture which allows us to keep Classic ASP has no high level programming structure. It is
everything separate. mixed of HTML and server side scripting.

#3360706 (AWT)  Unit 1 – Introduction to ASP.Net Web Programming &


Prof. Nima H Patel 6
Difference between ASP.NET and Classic ASP (Cont.)
Sr.
ASP.NET Classic ASP
No.
8 ASP.NET provides built-in validation controls. So, validating Classic ASP does not provide built-in validation controls. So,
pages are easy for developers. validating pages are difficult for developers.

9 ASP.NET supports inheritance. Classic ASP does not support inheritance.

10 ASP.NET provides separate files for code and data. Classic ASP provides single file for code and data.
11 ASP.NET supports custom controls. Classic ASP does not support custom controls.
12 For ASP.NET pages, file extension is .aspx For Classic ASP pages, file extension is .asp
13 ASP.NET uses ADO.NET (ActiveX Data Objects) to connect Classic ASP uses ADO (ActiveX Data Objects) to connect
and work with database. and work with database.

#3360706 (AWT)  Unit 1 – Introduction to ASP.Net Web Programming &


Prof. Nima H Patel 7
Difference between Web page/Web site and Web Application
Sr.
Web page/Web site Web Application
No.
1 Web site is informational. It is defined by its content. Web application is interactive. It is defined by its interaction
with user.

2 Website can be created in multi-programming languages. Web application can be created in only one programming
i.e. one web page in C# code and another page in vb.net language. i.e. we can select C# or vb.net programming
code. language during the creation of project.
3 Web sites will not create any .csproj/.vbproj files in project. Web application will create .csproj/.vbproj files in project.

4 No need to recompile web sites before deployment. Need to precompile web applications before deployment.

#3360706 (AWT)  Unit 1 – Introduction to ASP.Net Web Programming &


Prof. Nima H Patel 8
Common Language Runtime (CLR)
 CLR is the heart of the .NET framework.
 CLR manages the execution of the whole application.
 In the CLR, code is expressed as the byte code called the MSIL
(Microsoft Intermediate Language) code. C# Code VB.Net Code J# Code
 Developers using the CLR, write code in a language such as C# or
VB.NET.
 At compile time, a .NET compiler converts such code into MSIL code. Compiler Compiler Compiler
 During runtime, the CLR converts the MSIL code into something can
be understood by the operating system.
 At runtime, MSIL’s just-in-time compiler converts the MSIL into native
code. Microsoft Intermediate
JIT
 JIT compiler converts the MSIL code in to the native code which is Language (MSIL)
Compiler
related to the particular systems.
 Rather than converting all the code to the native code, JIT compiler Common Language Runtime
will converts the required amount of code to the Native code and (CLR)
saves the time and memory both.
 CLR manages memory, thread execution, garbage collection,
exception handling, common type system, code safety verifications 101011100011010
and other system services.
#3360706 (AWT)  Unit 1 – Introduction to ASP.Net Web Programming &
Prof. Nima H Patel 9
Common Type System (CTS)
 As .NET framework is a language independent and support over 60 different programming
languages, many programming language will write data types in their own programming
languages.
 For Example: To use any data type in C# and VB.NET,
Class Library Name C# VB.NET Name
Int32 int Integer

Double double Double

Char char Char

String string String


 CTS defines basic data types that IL understands.
 Each .NET compliant language should map its data types to these standard data types.
 This makes possible for the 2 languages to communicate with each other
by passing/receiving parameters to/from each other.
#3360706 (AWT)  Unit 1 – Introduction to ASP.Net Web Programming &
Prof. Nima H Patel 10
Common Language Specification (CLS)
 CLS is a document that says how computer program can be turned into byte code.
 CLS is a set of basic language feature that .NET languages needed to develop application and
services which are compatible with .NET framework.
 CLS ensures complete interoperability among applications, regardless of language which used
to create application.
 CLS is a subset of CTS.

VB C#
Dim a as Integer int a;
Dim b as Integer int b;
Dim c as Integer int c;

a=10 a=10;
b=20 b=20;
c=a+b c=a+b;

#3360706 (AWT)  Unit 1 – Introduction to ASP.Net Web Programming &


Prof. Nima H Patel 11
Components of Web Application
Components of Web
Application

Web Form Web Control Web.config Machine.config Global.asax


 The global.asax
machine.config file, also known
file is as the ASP.NET
the master application
configuration file onfile.
our
It issystem
ASP.NET web
Configuration
 ASP.NET web with
an optional fileafile
server
form islot aofprogrammable
that default
controls
isused aresettings.
contains
to manage code
objects for
various
web responding
onpage
ASP.NET
settings web
(.aspxthattodefine
application-level
pages
file). athat events
run when
website. raisedis requested.
the page
 by
 Acts
ManyASP.NET.
These
These settings
asweb
a user
server
settings of mahine.config
interface
arecontrols
stored(UI)are
inofthe file
anXML are
ASP.NET
similar applied
tofiles to the
application.
HTMLthatelements,
are whole
suchfrom
separate as buttons and text boxes.
your application
ASP.NET
There
code.
 Consists applications
is only
of one
HTML, onand
ourcontrols
global.asax
code server.
file per which
application.
 Other controls have complex behavior suchare as executed
a calendaroncontrols
a web server.
and data controls that you can use to connect
 Each
 User .NET
will
Global.asax
to data
Generally a framework
see the is
file
sources
website result
and locatedversion
in the
display
contains form
indata. hasofonly
HTML
application’s
a single one
root
Web.config machine.config
page which
file. was generated by the web server.
directory.
 file.
Application file
Web.config events are: inside the application root directory.
is stored
 The machine.config will share values between many
 There are number of settings that
Application_Start can be stored in the configuration file.
applications on the server. Application_End Session_Start Session_End
Database connections Caching settings Session states
Error Handling Security
#3360706 (AWT)  Unit 1 – Introduction to ASP.Net Web Programming &
Prof. Nima H Patel 12
Machine.config v/s Web.config v/s Global.asax
Machine.config Web.config Global.asax
It is class file & has built in
It is in XML format. It is in XML format.
methods.
Only one machine.config file in the More than one web.config file Only one global.asax file per
whole ASP.NET application. creation possible per project. project.
Settings are applied to the whole Settings are applied to the Settings are applied to the
ASP.NET application particular project only particular project only
For any changes, need to re-start For any changes, no need to For any changes, need to
the ASP.NET application. compile/re-start a web application. compile/re-build a web application.
Automatically installed when we Automatically created when we Optional file, does not created
install Visual Studio.Net. create ASP.NET project. automatically.
Stores configuration data i.e. Stores application level events i.e.
Stores lots of default settings
compilation options. application_start, session_start

#3360706 (AWT)  Unit 1 – Introduction to ASP.Net Web Programming &


Prof. Nima H Patel 13
Client Server Architecture
 Client-server architecture has 3 layers (tiers).
 It has user interface, business process and data storage & access which are developed and
maintained as independent modules or most often on separate platforms.

Presentation Layer Tier - 1

Business Layer Tier - 2

Data Layer Tier - 3

3 – Tier Client-Server Architecture


#3360706 (AWT)  Unit 1 – Introduction to ASP.Net Web Programming &
Prof. Nima H Patel 14
Client Server Architecture
Username

Step-1 Password Presentation Layer Great !!! You are Step-6


logged in.
Login

Step-2 Business Layer Step-5

Details Details are


are correct
correct ?
Data Layer

Step-3 Step-4

#3360706 (AWT)  Unit 1 – Introduction to ASP.Net Web Programming &


Prof. Nima H Patel 15
Difference between 2-Tier and 3-Tier Architecture
Sr.
2-Tier Architecture 3-Tier Architecture
No.
Client-1 Client-2 Client-1 Client-2
1

User Interface or User Interface or


Display Logic Display Logic User Interface or User Interface or
Display Logic Display Logic
Business Logic Business Logic
Business Logic
Middle-tier Database Logic Database Logic
Database Logic Server
Resources
Resources

Database Database

#3360706 (AWT)  Unit 1 – Introduction to ASP.Net Web Programming &


Prof. Nima H Patel 16
Difference between 2-Tier and 3-Tier Architecture
Sr.
2-Tier Architecture 3-Tier Architecture
No.
2 It has 2 layers: It has 3 layers:
 Presentation Layer  Presentation Layer
 Data Layer  Business Layer
 Data Layer

3 Less secure compare to 3-Tier Architecture More secure compare to 2-Tier Architecture

4 Poor performance Good performance


5 Only one database can be used Multiple database can be used

6 Less reusability More reusability


7 Tough task to maintain Easy task to maintain

#3360706 (AWT)  Unit 1 – Introduction to ASP.Net Web Programming &


Prof. Nima H Patel 17
 Looping
What we learned
• Features of ASP.NET
• Differences between ASP.NET and Classic ASP
• Web Applications and Web page
• Components of Web Application
• Client Server Architecture

Creating simple Web application


in ASP.NET
Next Topic
Creating simple Web application
in ASP.NET
Section - 2
Introduction to Visual Studio

An IDE (Integrated Development Environment)


Developed by Microsoft
Used to develop computer programs, websites, mobile apps etc.
Microsoft Supports 60 different programming languages
Visual
First Version : Visual Studio 97
Studio Release Date : 19th March 1997
Latest Version : Visual Studio 2019
Release Date : 2nd April 2019

#3360706 (AWT)  Unit 1 – Introduction to ASP.Net Web Programming &


Prof. Nima H Patel 20
Creating a new Web Project
 To create a new
web project,
follow steps in
given images.

#3360706 (AWT)  Unit 1 – Introduction to ASP.Net Web Programming &


Prof. Nima H Patel 21
Visual Studio Work Environment
File
Menu
 Help
View
Tools
Edit Menu
bar
Windows
DebugMenu
Menu
Menu
Menu
Menu
Menu
 Contains
 Different
menus
commands are
for
opening
given such
accessing
displaying
arranging
debugging
such as Cut, as
(i.e.
and
IDE
the
projects,
File, Edit,Paste,
IDE’s
windows
displaying
additional
identifying
Copy, View,
help
and
IDE
closing
Project etc.
features.
toolbars.
windows.
tools
correcting
Delete, Undo,
and
projects,
options
problems
Redo etc. that in
recent
enable
program) files
and
etc.
customization
running a
of
program.
the IDE.

#3360706 (AWT)  Unit 1 – Introduction to ASP.Net Web Programming &


Prof. Nima H Patel 22
Visual Studio Work Environment
 Solution
Properties:
Toolbox:
Explorer:
 Properties
Toolbox
window
 Solution
displays
contains the
explorer
properties
controls used
window for
ato form
customize
provides or
control.
forms. to all
access
 the files in the
Properties
Programmers
solution.
specify
can “drag and
information
drop” controls
such
onto theas form.
size,
color and
position.

#3360706 (AWT)  Unit 1 – Introduction to ASP.Net Web Programming &


Prof. Nima H Patel 23
Opening an Existing Web Project
 To open any
project, follow
steps in given
images.

#3360706 (AWT)  Unit 1 – Introduction to ASP.Net Web Programming &


Prof. Nima H Patel 24
Building Web Sites
 To build a web
site, follow
steps in given
images.

#3360706 (AWT)  Unit 1 – Introduction to ASP.Net Web Programming &


Prof. Nima H Patel 25
 Looping
What we learned
• Introduction to Visual Studio
• Visual Studio work environment
• Creating a New Web Project
• Opening an Existing Web Site
• Building Web Sites

Working with ASP.NET Web Forms


Next Topic
Working with ASP.NET Web Forms
Section - 3
Types of ASP.NET Files
.asax
.aspx
.config
.cs,
.dll
.master
.sln
.mdb,
 .skin.vb.ldb
 Master
ASP.NET
A
.cs
.dll
Global.asax
An solution
and
file is.vbpage
Access
contains web
are
filea
forms
configuration
source
compiled
defines
for
file is Visual
database
property pages
code
also
the
file.
that
file
files.
class
layout
Studio
knowncontains
settings project.
contain
library
for
as
to
web
XML
(assembly)
other
ASP.NET
 apply
They controls,
todefineweb
presentation
(eXtensible
file.
pages
application
controls
code in can
that the
for
 .mdfand
Markup
application.
file.a web
In business
 consistent
be sharedsite
logic.
Language)
 formatting.
between
project,
It SQL
An is Server we
an
elements
pages
locate
optional
Express suchthat file
as
represent
code
compiled
that contains
database for
file.
setting
custom
assemblies
code for
for
in
ASP.NET
classes,
the
responding
Bin sub to
features.
business
directory
application- as
logic,
shown
level ineventsHTTP
fig.
modules
raised and
by
HTTP
ASP.NET.
handlers.

#3360706 (AWT)  Unit 1 – Introduction to ASP.Net Web Programming &


Prof. Nima H Patel 28
Web Form Round Trip
 The browser presents a form to user and user interacts with the form, causing the form to post
back to the server.
 All the processes that interact with server components must occur on the server.
 It means for each 1
process, the form Request for a web page. Ex: www.darshan.ac.in
must be posted
to the server, 2
processed and Web page returned
returned to the
browser. Client 3 Server
 This sequence of Process completed @ client side and submits details
events is referred
as a “Round Trip 4
of a Web Form”. Process the request and return the response

#3360706 (AWT)  Unit 1 – Introduction to ASP.Net Web Programming &


Prof. Nima H Patel 29
Stages in Web Form Processing
 When a user request for ASP.NET page, the page gone through many stages that is called its
life cycle. ASP.NET checks that page request is new
Page or old.
 Various stages in ASP.NET web page are: Request New Page  Compiles & Executes
Old Page  Returns Cached copy
Request and response
properties of the page are Unload Start
unloaded and cleaning
performed if required. Request and response
properties are set and using
IsPostBack property new or
old request can be
View state of the controls on the identified.
page is saved before rendering
on the server. Rendering Initialization
The page calls the Render
method for every control.
Controls
Request are
is available
post backon the
andpage.
control
Load Every control has
properties areUnique ID property.
loaded with
information.
#3360706 (AWT)  Unit 1 – Introduction to ASP.Net Web Programming &
Prof. Nima H Patel 30
ASP.NET Objects
 Describe the methods, properties and collections of the
Request Object object that stores information related to the HTTP request.
 This includes forms, cookies, server variables.

 Collection of objects stores information related to the


Response Object server’s response. Includes displaying content, manipulating
headers, setting locales & redirecting requests.

 Describes methods, properties of objects provide methods


Server Object for various server tasks.
 Methods are useful to execute code, to get error conditions.

 Collection of objects stores information related to the entire


Application Object web application including variables & objects that exist for
the lifetime of the application.
 Collection of objects stores information related to the user’s
Session Object session including variables and objects that exist for the
lifetime of the session.
#3360706 (AWT)  Unit 1 – Introduction to ASP.Net Web Programming &
Prof. Nima H Patel 31
ASP.NET Page Structure
 Page
Code
ASP.NET
DirectiveLayout:
Section:
Section:
page is
made
The code up section
page of a
layout
page
number
provides
directivesof server
set the
up
handlers
interface
the environment
controls for
of the
along
page
page.
for the andpage
control
to
with HTML
 events
Itrun.contains
along with
the
controls,
 other
server
text and
functions
Page directives
controls,
images.
required.
text
specify andhowHTMLthe
 The
tags.
page should
ASP.NET page event
be
is
handlers
processed and
are
also a
functions
which server
bound
side
to thefile
assumption saved
controls.need
with
to bethe taken.aspx
about
extension.
the page.

#3360706 (AWT)  Unit 1 – Introduction to ASP.Net Web Programming &


Prof. Nima H Patel 32
Concept of Postback in ASP.NET
 As we have studied, page_load event fires every time when a web page is loaded.
 But sometimes you need code to load a page for the very first time.
 You can check whether this is the initial loading of the page by querying the IsPostBack
property of the Page Object.
 This property will return False, if the page is loaded for the first time and it will return True, if
the page is already loaded once.

#3360706 (AWT)  Unit 1 – Introduction to ASP.Net Web Programming &


Prof. Nima H Patel 33
 Looping
What we learned
• Types of ASP.NET files
• Web Form Round Trip
• Stage in Web Form Processing
• ASP.NET Objects
• ASP.NET Page Structure
• Concept of Postback in ASP.NET
Advance Web Technology (AWT)
GTU # 3330706

Thank
You

Prof. Nima H. Patel


Computer Engineering Department
Darshan Institute of Engineering & Technology for Diploma Studies, Rajkot
nima.patel@​darshan.ac.in

You might also like