SlideShare a Scribd company logo
6/17/2013 1
SETEC Institute [Web Development
with ASP.NET , prepare by ASP.NET
Lecturer Team.]
ASP.NET Overview
6/17/2013SETEC Institute [Web Development with
ASP.NET , prepare by ASP.NET Lecturer Team.]
2
 ASP.NET is a Microsoft technology for building web applications
that leverages all the fantastic technologies you can find in .NET
Framework.
 ASP.NET is an exciting web programming technology pioneered by
Microsoft that allows developers to create dynamic web pages.
 ASP.NET is a robust and mature technology. ASP.NET version 1.0
was released in January 2002 and quickly became the web
programming technology of choice for many. In November 2005,
Microsoft released the much-anticipated version 2.0. Two years
later, in November 2007, Microsoft released ASP.NET version 3.5.
And ASP.NET 4 was unveiled in April 2010.
 SQL Server 2008 is a database engine, which is a specialized
application designed to efficiently store and query data. Many
websites interact with databases; any ecommerce website, for
example, displays product information and records purchase orders
in a database.
ASP.NET websites and web pages
6/17/2013SETEC Institute [Web Development with
ASP.NET , prepare by ASP.NET Lecturer Team.]
3
 ASP.NET web pages are simple text files, meaning that you
can create them using any text editor (such as Microsoft
Notepad), but if you’ve created websites before, you know that
using a tool such as Microsoft Expression
 Web or Adobe Dreamweaver makes the development process
much easier than using a generic text editor such as Notepad.
This is the case for ASP.NET, as well.
 Before we create our first ASP.NET website, we need to install
the .NET Framework, Visual Web Developer, and SQL Server.
 The .NET Framework is a rich platform for creating Windows-
based applications and is the underlying technology used to
create ASP.NET websites.
Dynamic Website with ASP.NET
6/17/2013SETEC Institute [Web Development with
ASP.NET , prepare by ASP.NET Lecturer Team.]
4
Web Application
6/17/2013SETEC Institute [Web Development with ASP.NET , prepare by ASP.NET Lecturer Team.]
5
 A collection of Web Pages, comprising images, video,
and other digital assets providing relevant
information.
 A Web Application make use of the Internet to make
itself accessible to users from all over the world
through web browsers.
 In order to develop Web application, one should be
well-conversant with ASP.NET technology.
The Usage of Web Applications
6/17/2013SETEC Institute [Web Development with
ASP.NET , prepare by ASP.NET Lecturer Team.]
6
Web Applications serve the following fields:
 Communication
 Shopping
 Searching
 Education
 Entertainment
What is ASP.NET?
6/17/2013SETEC Institute [Web Development with
ASP.NET , prepare by ASP.NET Lecturer Team.]
7
 ASP.NET is only one of many technologies that can
be employed to create dynamic web pages.
 A technology to develop content-rich dynamic and
personalized websites.
 Developing ASP.NET Web application is similar to
developing Widows applications.
 The fundamental component of ASP.NET is the Web
Form.
 An ASP.NET web application can have one or more
Web Forms.
How does ASP.NET work?
6/17/2013SETEC Institute [Web Development with
ASP.NET , prepare by ASP.NET Lecturer Team.]
8
The Constituents of ASP.NET Application
6/17/2013SETEC Institute [Web Development with
ASP.NET , prepare by ASP.NET Lecturer Team.]
9
 Web Forms or .aspx Pages
 A web page that the user view in the web browser.
 A dynamic page that accesses server resources.
 It provides the UI for the Web Application.
 Code-behind pages
 Pages associated with Web Forms and contain the server-side
code for the Web Form such as VB.NET, C#.NET, J# …ect.
 Configuration files
 XML file that defines the default settings for Web Application
and the Web Server.
The Constituents of ASP.NET Application
6/17/2013SETEC Institute [Web Development with
ASP.NET , prepare by ASP.NET Lecturer Team.]
10
 Global.asax file
 The file contains the code required to respond to application-
level events that are raised by ASP.NET.
 XML Web Service links
 They allow Web Applications to send/receive the data from an
XML Web service.
 Database Connectivity
 It allows Web applications to transfer the date to/from
database sources.
 Caching
 It allows Web applications to return Web Forms and data
more quickly after the first request.
Basic Principle of ASP.NET
6/17/2013SETEC Institute [Web Development with
ASP.NET , prepare by ASP.NET Lecturer Team.]
11
 Developing ASP.NET bases on CLR shared by all
.NET Applications
 Developers can write code in ASP.NET by using
programming language supported .NET framework
such as C#, VB.NET, … and some third party
language such as PERL, or COBOL.
 ASP.NET use .NET framework as an infrastructure
so with the rich set of features of the .NET controls,
classes and tools can cut down the development
times.
ASP.NET Coding Techniques
6/17/2013SETEC Institute [Web Development with
ASP.NET , prepare by ASP.NET Lecturer Team.]
12
 The methodologies use for writing code in a Web
application.
 ASP.NET supports two different code techniques:
 Single-file page model: developers write code directly in the
Web Form.
 Code-behind page model: developers write code on another
page for the Web Form.
Single-File Page Model
6/17/2013SETEC Institute [Web Development with
ASP.NET , prepare by ASP.NET Lecturer Team.]
13
<%@ Page Language="VB" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<script runat="server">
Protected Sub Button1_Click(ByVal sender As Object,
ByVal e As System.EventArgs)
Label1.Text = "Hello " & Textbox1.Text
End Sub
</script>
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Simple Page</title>
</head>
<body>
<form id="form1" runat="server">
What is your name?<br />
<asp:Textbox ID="Textbox1" Runat="server"></asp:Textbox><br />
<asp:Button ID="Button1" Runat="server" Text="Submit" OnClick="Button1_Click" />
<p><asp:Label ID="Label1" Runat="server"></asp:Label></p>
</form>
</body>
</HTML>
Code-Behind Page Model
6/17/2013SETEC Institute [Web Development with
ASP.NET , prepare by ASP.NET Lecturer Team.]
14
< %@ Page Language="VB" AutoEventWireup="false" CodeFile="Default.aspx.vb" Inherits="_Default" % >
< !DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd" >
< html xmlns="http://www.w3.org/1999/xhtml" >
< head runat="server" >
< title > Simple Page < /title >
< /head >
< body >
< form id="form1" runat="server" >
What is your name? < br / >
< asp:Textbox ID="Textbox1" Runat="server" > < /asp:Textbox > < br / >
< asp:Button ID="Button1" Runat="server" Text="Submit" OnClick="Button1_Click" / >
< p > < asp:Label ID="Label1" Runat="server" > < /asp:Label > < /p >
< /form >
< /body >
< /html > Partial Class _Default
Inherits System.Web.UI.Page
Protected Sub Button1_Click(ByVal sender As Object, _ ByVal e As System.EventArgs) Handles
Button1.Click
Label1.Text = "Hello " & TextBox1.Text
End Sub
End Class
.aspx Code page
.aspx.vb Code page
Code Declaration Blocks
6/17/2013SETEC Institute [Web Development with
ASP.NET , prepare by ASP.NET Lecturer Team.]
15
 Code declaration blocks are used to
define the sections of sever-side code
that is embedded in
The global.asax file within the <script>
blocks and
Set the attribute runat=“server”.
Getting start with ASP.NET
6/17/2013SETEC Institute [Web Development with
ASP.NET , prepare by ASP.NET Lecturer Team.]
18
 To start experiencing ASP.NET, all you have to do is
open Visual Studio and create a new web project. In
this first part, we’re going to use Web Forms as our
model.
 ASP.NET pages contain server controls, namely
objects. A server control is a server-side
programmable piece of a page.
 A Web Form is usually composed of two files
 A markup file : refers to a designing page
 A code file : is commonly referred to as code behind or code
beside
Getting start with ASP.NET
6/17/2013SETEC Institute [Web Development with
ASP.NET , prepare by ASP.NET Lecturer Team.]
19
 ASP.NET provides a transparent mechanism to handle
page compilation.
 The first time a user requests a page, if it’s not yet
compiled, both the page and its code are grouped and
compiled to disk. What happens next is similar to what
happens for other requests: the page is instantiated,
rendered, and served in the browser as HTML. This
process is completely transparent to the developer.
 ASP.NET continuously watches the file and, in case of
modifications, automatically discards the old version.
The new version is compiled instead, using the
previously exposed flow.
Getting start with ASP.NET
6/17/2013SETEC Institute [Web Development with
ASP.NET , prepare by ASP.NET Lecturer Team.]
20
Typical Architecture in ASP.NET
6/17/2013SETEC Institute [Web Development with
ASP.NET , prepare by ASP.NET Lecturer Team.]
21
Starting Visual Studio 2012
6/17/2013SETEC Institute [Web Development with
ASP.NET , prepare by ASP.NET Lecturer Team.]
22
=> Start => All Programs => Microsoft Visual Studio 2012
Creating a new Web Application with
Visual Studio 2012
6/17/2013SETEC Institute [Web Development with
ASP.NET , prepare by ASP.NET Lecturer Team.]
23
=> File => New => Web Site
Creating a new Web Application
with Visual Studio 2012
6/17/2013SETEC Institute [Web Development with
ASP.NET , prepare by ASP.NET Lecturer Team.]
24
=> You will see a window looks like
First New Web Site with
Visual Studio 2012 Looks Like
6/17/2013SETEC Institute [Web Development with
ASP.NET , prepare by ASP.NET Lecturer Team.]
25
 The default web page look like
Creating a New Web page for the Web Site
with Visual Studio 2012
6/17/2013SETEC Institute [Web Development with
ASP.NET , prepare by ASP.NET Lecturer Team.]
26
File => New => File
The below Window will appears:
Visual Studio 2012 Environment
6/17/2013SETEC Institute [Web Development with
ASP.NET , prepare by ASP.NET Lecturer Team.]
27
Server Explorer
for
Database
Connection
To show code-design page
ToolBox for
Designing
To show Design Form
Solution Explorer to
show all pages
Properties window
to set properties
To run the Web Page
First Program with ASP.NET
6/17/2013SETEC Institute [Web Development with
ASP.NET , prepare by ASP.NET Lecturer Team.]
28
 The Web page below, you will design an .aspx page
with
 A TextArea name txtName
 A Label named lblWelcome
 A Button named btnOK
 When the Page load, you have to enter your name
into the TextBox.
 After that, you click on the Button. Then the label
will display the welcome sentence.
Solving Problem
6/17/2013SETEC Institute [Web Development with
ASP.NET , prepare by ASP.NET Lecturer Team.]
29
1. Start a new Web Site naming “Ch1”
Solving Problem
6/17/2013SETEC Institute [Web Development with
ASP.NET , prepare by ASP.NET Lecturer Team.]
30
2. Start a new Web page/form naming “Ch1_1.aspx”
Solving Problem
6/17/2013SETEC Institute [Web Development with
ASP.NET , prepare by ASP.NET Lecturer Team.]
31
3. Add the page controls using ToolBox and Set properties
- TextBox
o ID : txtName
o BackColor : Light Yellow
o ForeColor : Blue
- Label
o ID : lblWelcome
o Text :
o BackColor : Light Orange
o ForeColor : Dark Red
- Button
o ID : btnOK
o Text : OK
Solving Problem
6/17/2013SETEC Institute [Web Development with
ASP.NET , prepare by ASP.NET Lecturer Team.]
32
4. Write code for the Button to display the welcome
sentence in the label.
Double click on the button on the .aspx design page to
write behind code on .aspx.vb code page. Then write code as
below.
Running the Web Page
6/17/2013SETEC Institute [Web Development with
ASP.NET , prepare by ASP.NET Lecturer Team.]
33
Run the Web page and enter the name Click on “OK”.
End
6/17/2013 34SETEC Institute [Web Development with ASP.NET , prepare by ASP.NET Lecturer Team.]
Summary
6/17/2013SETEC Institute [Web Development with ASP.NET , prepare by ASP.NET Lecturer Team.] 35
1. ASP.NET is not a programming language but is a dot net
technology for Internet Programming.
2. ASP.NET is a powerful for developing aWebApplication.
3. Web page is a page or form in a website.
4. Web application is a web site containing as many pages and
data stored in a database.
5. Contents of dynamic web application are normally stored in
a database that can be loaded to the page and the page
contain only controls.
6. Visual Studio is an IDE for all the Microsoft .Net framework
form and window development.
Review Questions
6/17/2013SETEC Institute [Web Development with ASP.NET , prepare by ASP.NET Lecturer Team.] 36
1. What and Why ASP.NET?
2. What are the three layer technology?
3. What is a web page? a web site? an web
application?
4. How to create a new web site? a new web page?
5. What are the constituents of ASP.NET?
6. What are the two coding techniques supported by
ASP.NET 4.0?

More Related Content

PPT
Your First ASP_Net project part 1
PPTX
ASP.NET Lecture 1
DOC
Tutorial asp.net
PPT
ASP.NET Tutorial - Presentation 1
PPTX
Introduction to ASP.NET
PPTX
Web forms in ASP.net
PPTX
Introduction to asp
PPT
Asp.net
Your First ASP_Net project part 1
ASP.NET Lecture 1
Tutorial asp.net
ASP.NET Tutorial - Presentation 1
Introduction to ASP.NET
Web forms in ASP.net
Introduction to asp
Asp.net

What's hot (20)

PPTX
Industrial training seminar ppt on asp.net
PPT
PPSX
ASP.NET Web form
DOC
Asp.Net Tutorials
PDF
Modern Web App Architectures
PPS
Asp.Net 2.0 Presentation
PPT
Rutgers - Active Server Pages
PPTX
Introduction to asp.net
PDF
C# ASP.NET WEB API APPLICATION DEVELOPMENT
PPTX
ASP.NET - Introduction to Web Forms and MVC
PPTX
TypeScript and SharePoint Framework
PPTX
Harish Understanding Aspnet
PPTX
Walther Aspnet4
PPTX
Walther Ajax4
PPTX
Chris O'Brien - Introduction to the SharePoint Framework for developers
PPT
DevNext - Web Programming Concepts Using Asp Net
PDF
The road to professional web development
PPTX
ACTIVE SERVER PAGES BY SAIKIRAN PANJALA
PPTX
Harish Aspnet Deployment
PPTX
Chris O'Brien - Modern SharePoint sites and the SharePoint Framework - reference
Industrial training seminar ppt on asp.net
ASP.NET Web form
Asp.Net Tutorials
Modern Web App Architectures
Asp.Net 2.0 Presentation
Rutgers - Active Server Pages
Introduction to asp.net
C# ASP.NET WEB API APPLICATION DEVELOPMENT
ASP.NET - Introduction to Web Forms and MVC
TypeScript and SharePoint Framework
Harish Understanding Aspnet
Walther Aspnet4
Walther Ajax4
Chris O'Brien - Introduction to the SharePoint Framework for developers
DevNext - Web Programming Concepts Using Asp Net
The road to professional web development
ACTIVE SERVER PAGES BY SAIKIRAN PANJALA
Harish Aspnet Deployment
Chris O'Brien - Modern SharePoint sites and the SharePoint Framework - reference
Ad

Viewers also liked (20)

PPT
Asp dot net long
PPTX
Parallelminds.asp.net with sp
PDF
Computer fundamentals
PPTX
Review Materi ASP.NET
PPT
E sampark with c#.net
PDF
Asp.Net 3 5 Part 1
PDF
Computer Notes
PDF
Asp.Net 3.5 Part 2
PDF
Computer Notes
PDF
Bai giang asp.net full
PPT
Intro To Asp Net And Web Forms
PDF
01 Computer Forensics Fundamentals - Notes
DOC
FUNDAMENTALS OF COMPUTER
PDF
Visual basic asp.net programming introduction
PDF
Bài 6: Điều khiển DetailsView, FormView, ListView, DataPager
PDF
tybsc it asp.net full unit 1,2,3,4,5,6 notes
PDF
tybsc it sem 5 Linux administration notes of unit 1,2,3,4,5,6 version 3
PPT
Developing an ASP.NET Web Application
Asp dot net long
Parallelminds.asp.net with sp
Computer fundamentals
Review Materi ASP.NET
E sampark with c#.net
Asp.Net 3 5 Part 1
Computer Notes
Asp.Net 3.5 Part 2
Computer Notes
Bai giang asp.net full
Intro To Asp Net And Web Forms
01 Computer Forensics Fundamentals - Notes
FUNDAMENTALS OF COMPUTER
Visual basic asp.net programming introduction
Bài 6: Điều khiển DetailsView, FormView, ListView, DataPager
tybsc it asp.net full unit 1,2,3,4,5,6 notes
tybsc it sem 5 Linux administration notes of unit 1,2,3,4,5,6 version 3
Developing an ASP.NET Web Application
Ad

Similar to Chapter 1 (asp.net over view) (20)

PPT
Aspnet2.0 Introduction
PPTX
Benefits of Using ASP.NET For Web Development for Businesses In 2023
PDF
Asp.net Web Development.pdf
PPTX
ASP.NET Presentation
DOCX
Beginners introduction to asp.net
PDF
Web Development with ASP.NET: Taking Control of the Digital World
PDF
Unlocking the Power of ASP.NET: A Comprehensive Guide
PPTX
Lect 1 About ASP.NET webforms and freme
PDF
Top 8 Reasons ASP.NET Core is the Best Framework for Web Application Developm...
PDF
Asp.net Web Development.pdf
PPSX
Web development concepts using microsoft technologies
PPSX
A comprehensive software infrastructure of .Net
PDF
Workspace on asp.net web aplication development
PDF
Workspace on asp.net web aplication development
PPTX
Food borne human diseases
PDF
Asp.net Vs Vue.js.pdf
PDF
A Deep Dive into Android App Development 2.0.pdf
PDF
ASP.NET Core Web Development From Beginner to Pro.pdf
PDF
5 Ways ASP.Net Core Enhances Enterprise Application Performance.pdf
PDF
Why ASP.Net Core is Ideal for Developing High-Performance Enterprise Apps.pdf
Aspnet2.0 Introduction
Benefits of Using ASP.NET For Web Development for Businesses In 2023
Asp.net Web Development.pdf
ASP.NET Presentation
Beginners introduction to asp.net
Web Development with ASP.NET: Taking Control of the Digital World
Unlocking the Power of ASP.NET: A Comprehensive Guide
Lect 1 About ASP.NET webforms and freme
Top 8 Reasons ASP.NET Core is the Best Framework for Web Application Developm...
Asp.net Web Development.pdf
Web development concepts using microsoft technologies
A comprehensive software infrastructure of .Net
Workspace on asp.net web aplication development
Workspace on asp.net web aplication development
Food borne human diseases
Asp.net Vs Vue.js.pdf
A Deep Dive into Android App Development 2.0.pdf
ASP.NET Core Web Development From Beginner to Pro.pdf
5 Ways ASP.Net Core Enhances Enterprise Application Performance.pdf
Why ASP.Net Core is Ideal for Developing High-Performance Enterprise Apps.pdf

More from let's go to study (20)

PPTX
Rs instructor ppt_chapter11_final
PDF
Before beginning
PDF
Chapter 8 (security)
PDF
Chapter 7 (ado.net)
PDF
Chapter 6 (data binding)
PDF
Chapter 5 (master page)
PDF
Chapter 4 (navigater)
PDF
Chapter 3 (validation control)
PDF
Chapter 2 (web servercontrol)
PDF
Before beginning
PPT
PPT
PPT
PPT
PPTX
database design process
PPTX
009 sql server management studio
PPTX
007 sql server-installation
PPT
Chapter 2-html-tage
PDF
Chapter 0 before you start
Rs instructor ppt_chapter11_final
Before beginning
Chapter 8 (security)
Chapter 7 (ado.net)
Chapter 6 (data binding)
Chapter 5 (master page)
Chapter 4 (navigater)
Chapter 3 (validation control)
Chapter 2 (web servercontrol)
Before beginning
database design process
009 sql server management studio
007 sql server-installation
Chapter 2-html-tage
Chapter 0 before you start

Recently uploaded (20)

PPTX
IMMUNITY IMMUNITY refers to protection against infection, and the immune syst...
PDF
O5-L3 Freight Transport Ops (International) V1.pdf
PDF
01-Introduction-to-Information-Management.pdf
PPTX
Institutional Correction lecture only . . .
PPTX
The Healthy Child – Unit II | Child Health Nursing I | B.Sc Nursing 5th Semester
PPTX
Cell Structure & Organelles in detailed.
PDF
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
PDF
O7-L3 Supply Chain Operations - ICLT Program
PDF
Insiders guide to clinical Medicine.pdf
PDF
Basic Mud Logging Guide for educational purpose
PDF
VCE English Exam - Section C Student Revision Booklet
PDF
3rd Neelam Sanjeevareddy Memorial Lecture.pdf
PDF
Pre independence Education in Inndia.pdf
PDF
Abdominal Access Techniques with Prof. Dr. R K Mishra
PPTX
Cell Types and Its function , kingdom of life
PPTX
Introduction_to_Human_Anatomy_and_Physiology_for_B.Pharm.pptx
PPTX
Microbial diseases, their pathogenesis and prophylaxis
PDF
Chapter 2 Heredity, Prenatal Development, and Birth.pdf
PDF
ANTIBIOTICS.pptx.pdf………………… xxxxxxxxxxxxx
PPTX
Pharmacology of Heart Failure /Pharmacotherapy of CHF
IMMUNITY IMMUNITY refers to protection against infection, and the immune syst...
O5-L3 Freight Transport Ops (International) V1.pdf
01-Introduction-to-Information-Management.pdf
Institutional Correction lecture only . . .
The Healthy Child – Unit II | Child Health Nursing I | B.Sc Nursing 5th Semester
Cell Structure & Organelles in detailed.
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
O7-L3 Supply Chain Operations - ICLT Program
Insiders guide to clinical Medicine.pdf
Basic Mud Logging Guide for educational purpose
VCE English Exam - Section C Student Revision Booklet
3rd Neelam Sanjeevareddy Memorial Lecture.pdf
Pre independence Education in Inndia.pdf
Abdominal Access Techniques with Prof. Dr. R K Mishra
Cell Types and Its function , kingdom of life
Introduction_to_Human_Anatomy_and_Physiology_for_B.Pharm.pptx
Microbial diseases, their pathogenesis and prophylaxis
Chapter 2 Heredity, Prenatal Development, and Birth.pdf
ANTIBIOTICS.pptx.pdf………………… xxxxxxxxxxxxx
Pharmacology of Heart Failure /Pharmacotherapy of CHF

Chapter 1 (asp.net over view)

  • 1. 6/17/2013 1 SETEC Institute [Web Development with ASP.NET , prepare by ASP.NET Lecturer Team.]
  • 2. ASP.NET Overview 6/17/2013SETEC Institute [Web Development with ASP.NET , prepare by ASP.NET Lecturer Team.] 2  ASP.NET is a Microsoft technology for building web applications that leverages all the fantastic technologies you can find in .NET Framework.  ASP.NET is an exciting web programming technology pioneered by Microsoft that allows developers to create dynamic web pages.  ASP.NET is a robust and mature technology. ASP.NET version 1.0 was released in January 2002 and quickly became the web programming technology of choice for many. In November 2005, Microsoft released the much-anticipated version 2.0. Two years later, in November 2007, Microsoft released ASP.NET version 3.5. And ASP.NET 4 was unveiled in April 2010.  SQL Server 2008 is a database engine, which is a specialized application designed to efficiently store and query data. Many websites interact with databases; any ecommerce website, for example, displays product information and records purchase orders in a database.
  • 3. ASP.NET websites and web pages 6/17/2013SETEC Institute [Web Development with ASP.NET , prepare by ASP.NET Lecturer Team.] 3  ASP.NET web pages are simple text files, meaning that you can create them using any text editor (such as Microsoft Notepad), but if you’ve created websites before, you know that using a tool such as Microsoft Expression  Web or Adobe Dreamweaver makes the development process much easier than using a generic text editor such as Notepad. This is the case for ASP.NET, as well.  Before we create our first ASP.NET website, we need to install the .NET Framework, Visual Web Developer, and SQL Server.  The .NET Framework is a rich platform for creating Windows- based applications and is the underlying technology used to create ASP.NET websites.
  • 4. Dynamic Website with ASP.NET 6/17/2013SETEC Institute [Web Development with ASP.NET , prepare by ASP.NET Lecturer Team.] 4
  • 5. Web Application 6/17/2013SETEC Institute [Web Development with ASP.NET , prepare by ASP.NET Lecturer Team.] 5  A collection of Web Pages, comprising images, video, and other digital assets providing relevant information.  A Web Application make use of the Internet to make itself accessible to users from all over the world through web browsers.  In order to develop Web application, one should be well-conversant with ASP.NET technology.
  • 6. The Usage of Web Applications 6/17/2013SETEC Institute [Web Development with ASP.NET , prepare by ASP.NET Lecturer Team.] 6 Web Applications serve the following fields:  Communication  Shopping  Searching  Education  Entertainment
  • 7. What is ASP.NET? 6/17/2013SETEC Institute [Web Development with ASP.NET , prepare by ASP.NET Lecturer Team.] 7  ASP.NET is only one of many technologies that can be employed to create dynamic web pages.  A technology to develop content-rich dynamic and personalized websites.  Developing ASP.NET Web application is similar to developing Widows applications.  The fundamental component of ASP.NET is the Web Form.  An ASP.NET web application can have one or more Web Forms.
  • 8. How does ASP.NET work? 6/17/2013SETEC Institute [Web Development with ASP.NET , prepare by ASP.NET Lecturer Team.] 8
  • 9. The Constituents of ASP.NET Application 6/17/2013SETEC Institute [Web Development with ASP.NET , prepare by ASP.NET Lecturer Team.] 9  Web Forms or .aspx Pages  A web page that the user view in the web browser.  A dynamic page that accesses server resources.  It provides the UI for the Web Application.  Code-behind pages  Pages associated with Web Forms and contain the server-side code for the Web Form such as VB.NET, C#.NET, J# …ect.  Configuration files  XML file that defines the default settings for Web Application and the Web Server.
  • 10. The Constituents of ASP.NET Application 6/17/2013SETEC Institute [Web Development with ASP.NET , prepare by ASP.NET Lecturer Team.] 10  Global.asax file  The file contains the code required to respond to application- level events that are raised by ASP.NET.  XML Web Service links  They allow Web Applications to send/receive the data from an XML Web service.  Database Connectivity  It allows Web applications to transfer the date to/from database sources.  Caching  It allows Web applications to return Web Forms and data more quickly after the first request.
  • 11. Basic Principle of ASP.NET 6/17/2013SETEC Institute [Web Development with ASP.NET , prepare by ASP.NET Lecturer Team.] 11  Developing ASP.NET bases on CLR shared by all .NET Applications  Developers can write code in ASP.NET by using programming language supported .NET framework such as C#, VB.NET, … and some third party language such as PERL, or COBOL.  ASP.NET use .NET framework as an infrastructure so with the rich set of features of the .NET controls, classes and tools can cut down the development times.
  • 12. ASP.NET Coding Techniques 6/17/2013SETEC Institute [Web Development with ASP.NET , prepare by ASP.NET Lecturer Team.] 12  The methodologies use for writing code in a Web application.  ASP.NET supports two different code techniques:  Single-file page model: developers write code directly in the Web Form.  Code-behind page model: developers write code on another page for the Web Form.
  • 13. Single-File Page Model 6/17/2013SETEC Institute [Web Development with ASP.NET , prepare by ASP.NET Lecturer Team.] 13 <%@ Page Language="VB" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> <script runat="server"> Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Label1.Text = "Hello " & Textbox1.Text End Sub </script> <html xmlns="http://www.w3.org/1999/xhtml" > <head runat="server"> <title>Simple Page</title> </head> <body> <form id="form1" runat="server"> What is your name?<br /> <asp:Textbox ID="Textbox1" Runat="server"></asp:Textbox><br /> <asp:Button ID="Button1" Runat="server" Text="Submit" OnClick="Button1_Click" /> <p><asp:Label ID="Label1" Runat="server"></asp:Label></p> </form> </body> </HTML>
  • 14. Code-Behind Page Model 6/17/2013SETEC Institute [Web Development with ASP.NET , prepare by ASP.NET Lecturer Team.] 14 < %@ Page Language="VB" AutoEventWireup="false" CodeFile="Default.aspx.vb" Inherits="_Default" % > < !DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd" > < html xmlns="http://www.w3.org/1999/xhtml" > < head runat="server" > < title > Simple Page < /title > < /head > < body > < form id="form1" runat="server" > What is your name? < br / > < asp:Textbox ID="Textbox1" Runat="server" > < /asp:Textbox > < br / > < asp:Button ID="Button1" Runat="server" Text="Submit" OnClick="Button1_Click" / > < p > < asp:Label ID="Label1" Runat="server" > < /asp:Label > < /p > < /form > < /body > < /html > Partial Class _Default Inherits System.Web.UI.Page Protected Sub Button1_Click(ByVal sender As Object, _ ByVal e As System.EventArgs) Handles Button1.Click Label1.Text = "Hello " & TextBox1.Text End Sub End Class .aspx Code page .aspx.vb Code page
  • 15. Code Declaration Blocks 6/17/2013SETEC Institute [Web Development with ASP.NET , prepare by ASP.NET Lecturer Team.] 15  Code declaration blocks are used to define the sections of sever-side code that is embedded in The global.asax file within the <script> blocks and Set the attribute runat=“server”.
  • 16. Getting start with ASP.NET 6/17/2013SETEC Institute [Web Development with ASP.NET , prepare by ASP.NET Lecturer Team.] 18  To start experiencing ASP.NET, all you have to do is open Visual Studio and create a new web project. In this first part, we’re going to use Web Forms as our model.  ASP.NET pages contain server controls, namely objects. A server control is a server-side programmable piece of a page.  A Web Form is usually composed of two files  A markup file : refers to a designing page  A code file : is commonly referred to as code behind or code beside
  • 17. Getting start with ASP.NET 6/17/2013SETEC Institute [Web Development with ASP.NET , prepare by ASP.NET Lecturer Team.] 19  ASP.NET provides a transparent mechanism to handle page compilation.  The first time a user requests a page, if it’s not yet compiled, both the page and its code are grouped and compiled to disk. What happens next is similar to what happens for other requests: the page is instantiated, rendered, and served in the browser as HTML. This process is completely transparent to the developer.  ASP.NET continuously watches the file and, in case of modifications, automatically discards the old version. The new version is compiled instead, using the previously exposed flow.
  • 18. Getting start with ASP.NET 6/17/2013SETEC Institute [Web Development with ASP.NET , prepare by ASP.NET Lecturer Team.] 20
  • 19. Typical Architecture in ASP.NET 6/17/2013SETEC Institute [Web Development with ASP.NET , prepare by ASP.NET Lecturer Team.] 21
  • 20. Starting Visual Studio 2012 6/17/2013SETEC Institute [Web Development with ASP.NET , prepare by ASP.NET Lecturer Team.] 22 => Start => All Programs => Microsoft Visual Studio 2012
  • 21. Creating a new Web Application with Visual Studio 2012 6/17/2013SETEC Institute [Web Development with ASP.NET , prepare by ASP.NET Lecturer Team.] 23 => File => New => Web Site
  • 22. Creating a new Web Application with Visual Studio 2012 6/17/2013SETEC Institute [Web Development with ASP.NET , prepare by ASP.NET Lecturer Team.] 24 => You will see a window looks like
  • 23. First New Web Site with Visual Studio 2012 Looks Like 6/17/2013SETEC Institute [Web Development with ASP.NET , prepare by ASP.NET Lecturer Team.] 25  The default web page look like
  • 24. Creating a New Web page for the Web Site with Visual Studio 2012 6/17/2013SETEC Institute [Web Development with ASP.NET , prepare by ASP.NET Lecturer Team.] 26 File => New => File The below Window will appears:
  • 25. Visual Studio 2012 Environment 6/17/2013SETEC Institute [Web Development with ASP.NET , prepare by ASP.NET Lecturer Team.] 27 Server Explorer for Database Connection To show code-design page ToolBox for Designing To show Design Form Solution Explorer to show all pages Properties window to set properties To run the Web Page
  • 26. First Program with ASP.NET 6/17/2013SETEC Institute [Web Development with ASP.NET , prepare by ASP.NET Lecturer Team.] 28  The Web page below, you will design an .aspx page with  A TextArea name txtName  A Label named lblWelcome  A Button named btnOK  When the Page load, you have to enter your name into the TextBox.  After that, you click on the Button. Then the label will display the welcome sentence.
  • 27. Solving Problem 6/17/2013SETEC Institute [Web Development with ASP.NET , prepare by ASP.NET Lecturer Team.] 29 1. Start a new Web Site naming “Ch1”
  • 28. Solving Problem 6/17/2013SETEC Institute [Web Development with ASP.NET , prepare by ASP.NET Lecturer Team.] 30 2. Start a new Web page/form naming “Ch1_1.aspx”
  • 29. Solving Problem 6/17/2013SETEC Institute [Web Development with ASP.NET , prepare by ASP.NET Lecturer Team.] 31 3. Add the page controls using ToolBox and Set properties - TextBox o ID : txtName o BackColor : Light Yellow o ForeColor : Blue - Label o ID : lblWelcome o Text : o BackColor : Light Orange o ForeColor : Dark Red - Button o ID : btnOK o Text : OK
  • 30. Solving Problem 6/17/2013SETEC Institute [Web Development with ASP.NET , prepare by ASP.NET Lecturer Team.] 32 4. Write code for the Button to display the welcome sentence in the label. Double click on the button on the .aspx design page to write behind code on .aspx.vb code page. Then write code as below.
  • 31. Running the Web Page 6/17/2013SETEC Institute [Web Development with ASP.NET , prepare by ASP.NET Lecturer Team.] 33 Run the Web page and enter the name Click on “OK”.
  • 32. End 6/17/2013 34SETEC Institute [Web Development with ASP.NET , prepare by ASP.NET Lecturer Team.]
  • 33. Summary 6/17/2013SETEC Institute [Web Development with ASP.NET , prepare by ASP.NET Lecturer Team.] 35 1. ASP.NET is not a programming language but is a dot net technology for Internet Programming. 2. ASP.NET is a powerful for developing aWebApplication. 3. Web page is a page or form in a website. 4. Web application is a web site containing as many pages and data stored in a database. 5. Contents of dynamic web application are normally stored in a database that can be loaded to the page and the page contain only controls. 6. Visual Studio is an IDE for all the Microsoft .Net framework form and window development.
  • 34. Review Questions 6/17/2013SETEC Institute [Web Development with ASP.NET , prepare by ASP.NET Lecturer Team.] 36 1. What and Why ASP.NET? 2. What are the three layer technology? 3. What is a web page? a web site? an web application? 4. How to create a new web site? a new web page? 5. What are the constituents of ASP.NET? 6. What are the two coding techniques supported by ASP.NET 4.0?