SlideShare ist ein Scribd-Unternehmen logo
1 von 53
JATIYA KABI KAZI NAZRUL ISLAM UNIVERSITY

Presentation On

Submitted to
Mr. Tushar Kanti Saha
Lecturer Deprt of CSE,
JKKNIU

Submitted By
Rasel khan
Roll: 11102027
Session: 2010-2011
Dept Of CSE
ASP.NET OVERVIEW
 Introduction & History
 Why use ASP.NET, Some characteristics & with Component
 Steps for developing a web based application and how to work
request with response.

 Working with ASP.NET MVC Framework.
 How to work HTTP Fundamentals.
 ASP.NET web application Routing.
 ASP.NET IIS & how to create virtual directory.
ASP.NET mean is Active Server Pages . It is a server-side Web
application framework designed for Web development to produce
dynamic Web pages .It was developed by Microsoft to allow
programmers to build ,

• Dynamic web sites,
• Web applications
• Web services
• The latest version of ASP is known as ASP.NET
• Visual Studio .NET is a developer application used to
create ASP.NET Web applications
• There are two main types of Web resources created
with ASP.NET applications
– Web Forms are ASP.NET pages within an ASP.NET
application
– Web Services are ASP.NET Web pages that contain
publicly exposed code so that other applications can
interact with them
– Web Services are identified with the file extension .asmx
ASP.NET 1.0 was released on January 5, 2002 as part of version
1.0 of the .NET Framework.
Scott Guthrie became the product unit manager for ASP.NET, and
development continued apace, with version 1.1 being released on
April 24, 2003 as a part of Windows Server 2003. This release
focused on improving ASP.NET's support for mobile devices.


Improved Performance and Scalability.



Compiled Execution, Rich Output Caching, Web Farm Session State.



Enhanced Reliability.



Memory Leak, Dead Lock, and Crash Protection



Easy Deployment.



No Touch" Application Deployment, Dynamic Update of Running Application,
Easy Migration Path



New Application Models.



XML Web Services



Developer Productivity.



Easy Programming Model, Flexible Language Options, Rich Class Framework.
 Code-behind model


It is recommended by Microsoft for dealing with dynamic program code to use the
code-behind model, which places this code in a separate file or in a specially designated
script tag

 User


controls

ASP.NET supports creating reusable components through the creation of User Controls

 Rendering technique


ASP.NET uses a visited composites rendering technique. During compilation, the
template (.aspx) file is compiled into initialization code which builds a control tree (the
composite) representing the original template
• Compiled code
 Code written in ASP.NET is compile and not interpreted.

• Enriched tool support
 ASP.NET applications using visual studio

• Power and flexibility
 ASP.NET applications are based on the CLR

• Simplicity
 ASP.NET enables you to build user interfaces that separate application logic from
presentation content

• Manageability
 ASP.NET provides a number of options in providing the above facilities
 Server control

Respond to users events by running event procedures on
the server.
 HTML control

Represent the standard visual elements provided in
HTML
 Data control

Provide a way to connect to perform commands on and
retrieve data from SQL , OL ,databases and XML data
files
 System components

Provide access to various system level events that occur
on the server
Step 1

–

Step 2
Step 3
Step 4
Step 5
Step 6
Step 7

–
–
–
–
–
–

Create Local Folders for Your Web
Project
Create a Blank Solution
Add a Web Site to Your Solution
Add a Class Library (Optional)
Check Your Solution Structure
Check Your Local Folder Structure
Add Your Solution to Source Control
Web Server

Web Browser

Get default.aspx

1. Client Initiates
2. Communications
With page request

Display page
Server response with
pages

1. Process request
2. Execute server slide
code
3. Store session data
4. Send result response
ASP.NET MVC
Model View Controller (MVC) applications by using the ASP.NET framework
WHAT IS ASP.NET MVC?

Saying simply, ASP.NET MVC is a new framework from Microsoft that sits over
standard ASP.NET engine.

ASP.NET MVC

ASP.NET
ASP.NET MVC Features

1. Clear separation of logic: Model, View, Controller
2. Test-Driven Development (TDD)
3. Full control over HTML and JavaScript
4. Friendly URLs
MODEL + VIEW + CONTROLLER = MVC
ASP.NET MVC provides an alternative to the ASP.NET “Web Forms” pattern for creating
MVC-based Web applications.

Views display the application's
user interface (UI). Typically,
this UI is created from the
model data.

Model objects implement the logic
for the application's data domain.
Often, model objects retrieve and
store the app state in a database.

Model

View

Controller

Controllers handle user
interaction, work with the
model, and select a view to
render that displays UI
Test-Driven Development (TDD)

Since the UI is completely separated from
the business logic, it’s now easy to write Unit
Tests for the ASP.NET MVC application.

Unit Tests that cover
User Actions and Data Model

User Interface

Controller

Data Objects
Full control over HTML & JS
In ASP.NET MVC, designed HTML & JS pages are not more messed up with
“postbacks” and “ViewStates”, which is specific for “Web-forms” pattern.

<input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE"
value="/wEPaA8FDzhjYjBhZjA0ODYyMTM2NBgGBR5fX0NvbnRyb2xzUmVxdWlyZVBvc3RCYWNr
S2V5X18WAQUhY3RsMDAkaGVhZGVyJHVjTWFpbk1lbnUkc2VhcmNoQnRuBTdjdGwwMCRNYWl
uQ29udGVudCRycHRWaWRlbyRjdGwwMyRwcmVzZW50YXRpb25DYXJkJG11bHRp" />
<script type="text/javascript">
//<![CDATA[
var theForm = document.forms['aspnetForm'];
function __doPostBack(eventTarget, eventArgument) {
if (!theForm.onsubmit || (theForm.onsubmit() != false)) {
theForm.__EVENTTARGET.value = eventTarget;
theForm.__EVENTARGUMENT.value = eventArgument;
theForm.submit();
}
}
//]]>
</script>
Friendly URLs
MVC binds web paths to the logical URLs rather
than to the physical files.
Physical location:

C:InetpubwwwrootWebSiteProducts.aspx

ASP.NET style:

http://www.website.com/Products.aspx?name=Me
at

MVC style:

http://www.website.com/Products/Meat
HOW DOES ASP.NET MVC LOOKS LIKE?
ASP.NET MVC installs a new type of web project into VS2008.
A newly created project has an ASP.NET MVC
specific directory structure.
App_Data folder is the physical store for data.
Content folder keeps files such as scripts, CSS, images, and so on.
Controllers folder is the location for controllers. The MVC framework
requires the names of all controllers to end with "Controller"—for
example, HomeController, LoginController, or ProductController.
Models stores classes that handle application business logic.
Scripts folder is for script files that support the application. By default,
this folder contains AJAX script files and the JQuery library.

Views is the recommended location for views. Views use .aspx, .ascx,
and .master files, in addition to any other files that are related to
rendering views.
ASP.NET MVC supports pure MVC pattern, the same
development pattern Rails are based on. The advantages
of ASP.NET MVC applications:
1. It makes it easier to manage complexity by dividing an application into
the model, the view, and the controller.
2. It does not use view state or server-based forms.
3. It uses a Front Controller pattern that processes Web application
requests through a single controller. This enables you to design an
application that supports a rich routing infrastructure with friendly
URLs.
4. It provides better support for test-driven development (TDD).
5. It works well for Web applications that are supported by large teams
of developers and Web designers who need a high degree of control
over the application behavior.
 http://www.asp.net/mvc - official site
 http://weblogs.asp.net/scottgu/archive/2007/11/13/asp-net-mvcframework-part-1.aspx - development basics on ASP.NET MVC
 http://weblogs.asp.net/scottgu/archive/2007/12/03/asp-net-mvcframework-part-2-url-routing.aspx - URL routing used in ASP.NET MVC
 http://weblogs.asp.net/scottgu/archive/2007/12/06/asp-net-mvcframework-part-3-passing-viewdata-from-controllers-to-views.aspx interaction between Controllers and Views
 http://weblogs.asp.net/scottgu/archive/2007/12/09/asp-net-mvcframework-part-4-handling-form-edit-and-post-scenarios.aspx - managing
form input data
ASP.NET Web API
and HTTP Fundamentals
CRAMMING YOUR BRAINS WITH
HTTP & ASP.NET WEB API
•

HTTP Fundamentals via Web API

•

Dependency Resolver

•

HTTP Messages

•

URIs

•

HTTP.SYS

•

Routing

•

IIS 101

•

Verbs

•

HTTP compression

•

Controllers and Actions

•

Persisted Connections

•

Status Codes

•

Web API Self Hosting

•

HttpRequestMessage
HttpResponseMessage

•

Error Handling

•

Content Negotiation

•

Media Type Formatters

•

OData

•

Validations

•

•

Hosting

More HTTP and Web API

•

Caching

•

Concurrency

•

Security

•

Streaming

•

WebSockets & SignalR
26
WHY IS HTTP IMPORTANT?
 HTTP is a first class application layer protocol
 Unlike other protocols it was created to support a single information

system
 That system happened to be the largest and main information
system of the human race:

27
NO REALLY, WHY?

Today's systems face new challenges:
 Broader reach of clients
What About ASP.NET Web API?
• The .NET platform never had a first
class framework for HTTP-based
services
• WCF was created as a SOAP-based
framework and never really
matured to support HTTP

29
THE HISTORY OF ASP.NET WEB API
6 Preview Versions

WCF Web API
on CodePlex

WCF WebHttp
Binding (.NET 4)

ASP.NET Web API 4
Release

ASP.NET is
Open Source

ASP.NET Web API 2
Release Candidate

ASP.NET Web API
(Beta)

30
HTTP Messages 101
 HTTP is a first class application protocol:
 Widely supported across platforms and devices

 Scalable
 Simple

 Uses the request-response messaging
pattern
 Define resource-based semantics and not
RPC (Remote Procedure Call) or methods
31
HTTP REQUEST MESSAGES
GET http://localhost:2300/api/agents/Bond HTTP/1.1
Accept: text/html, application/xhtml+xml, */*
Accept-Language: en-US,en;q=0.7,he;q=0.3
User-Agent: Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.2; WOW64; Trident/6.0)
Accept-Encoding: gzip, deflate
Host: localhost:2300
DNT: 1
Connection: Keep-Alive

32
HTTP RESPONSE MESSAGES

HTTP/1.1 200 OK
Cache-Control: public, max-age=300
Content-Type: application/json; charset=utf-8
ETag: "1"
Server: Microsoft-IIS/8.0
X-AspNet-Version: 4.0.30319
Date: Mon, 19 Nov 2012 17:49:40 GMT
Content-Length: 142
{

"Id": "Bond",
"FullName": "James Bond",
"Alias": "007",
"Version": 1,
"Image": "http://localhost:2300/api/agents/Bond.jpg"
}

33
URIS
•

HTTP is not an RPC protocol

•

HTTP uses URIs to identify resources over the network

•

An HTTP URI has the following basic structure:

http://theagency.com:8080/agents?id=1
Schema

Host

Port

Absolute
Path

Query

34
CLEAN URLS AND ASP.NET
 Using clean URLs can be a problem with IIS
 IIS needs extensions to map requests to handlers
 Without extensions, IIS is lost
 ASP.NET Routing to the rescue with UrlRoutingModule
 It’s all about patterns… and mapping them to handlers
 The starting point of MVC, Dynamic Data, and Web API

 System.Web.Routing.RouteTable.Routes.MapHttpRoute

RouteTable.Routes.MapHttpRoute(
name: "DefaultApi",
routeTemplate: "api/{controller}/{id}",
defaults: new { id = RouteParameter.Optional }
);

35
ASP.NET WEB API - ROUTING
36
Routing with attributes


Why attributes over convention?
 Child (sub) resources
 Multiple type of parameters or return

values
 Versioning of actions and controllers


Start by enabling attribute routing
 config.MapHttpAttributeRoutes();

[RoutePrefix("api/agents/{agentId}")]
public class ObservationsController : ApiController
{
// GET api/agents/bond/observations
[HttpGet("observations/{date}")]
public Observation Get(string agentId, DateTime date) { ... }
}
Verbs
• HTTP defines a set of Methods or Verbs
that add an action-like semantics to
requests
• Verbs are defined as the first segment of
• the request-line:
GET http://localhost:4392/travelers/1 HTTP/1.1

• There are eight verbs defined in HTTP
1.1:
GET
POST
PUT
DELETE

HEAD
OPTIONS
TRACE
CONNECT

38
3, 2, 1, Actions!
• Actions are matched by HTTP verb names and
the existence of parameters
public class ProductsController : ApiController
{
public IEnumerable<Product> GetProducts() {...}
public Product GetProductById(int id) {...}
public HttpResponseMessage PostProduct(Product product) {...}
}

GET api/products
GET api/products/42
POST api/products
DELETE api/products/42
Status Codes
 Status codes describe the result of the server’s effort

to satisfy the request
 Passed in the response's status-line as three digit
alongside a textual description called reason phrase
 HTTP has five different categories of status-codes:






1xx – Informational
2xx – Success
3xx – Redirection
4xx – Client Error
5xx – Server Error

(100 / 101)
(200 – 206)
(300 – 307)
(400 – 417)
(500 – 505)
Status Code examples
•
•
•
•
•
•
•
•
41

404?
401?
304?
503?
500?
200?
301?
302?


Returning an HttpResponseMessage
allows more control over the response,
including:




Status code
HTTP headers
Entity body

public HttpResponseMessage CreateAgent(Agent agent)
{
agent = _repository.Add(agent);
var response =
Request.CreateResponse<Agent>(HttpStatusCode.Created, agent);
response.Headers.Location = GetAgentLocation(agent.Id);
return response;
}

42
Error Handling
• In HTTP services errors are handled by
▫ Returning an appropriate status code
▫ Returning an entity body explaining the error
(when applicable)

• Web API allows you to handle exceptions by
▫ Return an HttpResponseMessage with
appropriate status code (404, 500 …)
▫ Throw an HttpResponseException
▫ Create a general exception handler by using Filters
43
HTTP defines a process to best match the
server’s response to the client’s expectation
 Negotiation can be done using:


 Headers:

Accept, Accept- Language, Accept- Charset,
Accept-Encoding
 URI:
File extensions (.jpeg, .html), host-name: (com,
org), path and query

44
ASP.NET, IIS & how to create virtual
directory
SESSION OBJECTIVES
•
•
•
•
•
•

ASP.NET Benefit
How Does ASP.NET Work?
IIS
Creating a Virtual Directory
Web Sharing the Project Folder
Deleting a Web Project
HOW DOES ASP.NET WORK?
• Requests an HTML file, the server returns the file

• Requests an ASP.NET file, IIS passes the request to
the ASP.NET engine on the server
• The ASP.NET engine reads the file, line by line, and
executes the scripts in the file
• ASP.NET file is returned to the browser as plain HTML


Separation of Code from HTML



Graphical Development Environment



Update files while the server is running!



Support for compiled languages



State management
IIS – Internet Information Services
• Internet Information Service
• IIS (Internet Information Services) is Microsoft's
Internet server
• IIS comes as a free component with Windows
servers
• IIS is also a part of Windows 2000 and XP
Professional








Start, Settings, Control Panel, Administrative
Tools, Internet Services Manager
Expand node for computer and default Web
site
Right-click Default Web site icon, select New,
Virtual Directory
In Virtual Directory Creation Wizard enter
your project folder name as the alias and enter
the folder and path
Web Sharing the Project Folder
 Select the Project folder in My Computer
 Right-click, select Properties, Web Sharing, activate

Share This Folder
 In Edit Alias dialog click OK
Deleting a Web Project


Project in IIS Virtual Directory
 Delete the directory



Project in Web Shared Folder
 “Unshare” it from Properties dialog
 Either Reboot Computer or Stop and Restart IIS
 Delete Folder
Thank You All

Weitere ähnliche Inhalte

Was ist angesagt?

Atul Shende_Final CV
Atul Shende_Final CVAtul Shende_Final CV
Atul Shende_Final CVAtul Shende
 
Online computer lab management system
Online computer lab management systemOnline computer lab management system
Online computer lab management systemPranyta Karhe
 
java mini project for college students
java mini project for college students java mini project for college students
java mini project for college students SWETALEENA2
 
TestingResume_3.6Yrs
TestingResume_3.6YrsTestingResume_3.6Yrs
TestingResume_3.6YrsMcAfee
 
Synopsis on online shopping by sudeep singh
Synopsis on online shopping by  sudeep singhSynopsis on online shopping by  sudeep singh
Synopsis on online shopping by sudeep singhSudeep Singh
 
Project report On MSM (Mobile Shop Management)
Project report On MSM (Mobile Shop Management)Project report On MSM (Mobile Shop Management)
Project report On MSM (Mobile Shop Management)Dinesh Jogdand
 
Microsoft Sharepoint 2013 : The Ultimate Enterprise Collaboration Platform
Microsoft Sharepoint 2013 : The Ultimate Enterprise Collaboration PlatformMicrosoft Sharepoint 2013 : The Ultimate Enterprise Collaboration Platform
Microsoft Sharepoint 2013 : The Ultimate Enterprise Collaboration PlatformEdureka!
 
Task tracking system
Task tracking systemTask tracking system
Task tracking systemMaulik Thaker
 
Zarafa Repair is Possible in Few Clicks
Zarafa Repair is Possible in Few ClicksZarafa Repair is Possible in Few Clicks
Zarafa Repair is Possible in Few Clicksmacbethben
 
Cv vipul valvi_java_developer
Cv vipul valvi_java_developerCv vipul valvi_java_developer
Cv vipul valvi_java_developervipulvalvi3
 
A Software Engineering Project on Cyber cafe management
A Software Engineering Project on Cyber cafe managementA Software Engineering Project on Cyber cafe management
A Software Engineering Project on Cyber cafe managementsvrohith 9
 
Work experiences at Softcodeit
Work experiences at SoftcodeitWork experiences at Softcodeit
Work experiences at SoftcodeitVayodya Tamari
 
Design & development of job portal system using joomla & its online reputatio...
Design & development of job portal system using joomla & its online reputatio...Design & development of job portal system using joomla & its online reputatio...
Design & development of job portal system using joomla & its online reputatio...Dinesh Babu Pugalenthi
 

Was ist angesagt? (20)

Atul Shende_Final CV
Atul Shende_Final CVAtul Shende_Final CV
Atul Shende_Final CV
 
Suman
SumanSuman
Suman
 
Resume
ResumeResume
Resume
 
Online computer lab management system
Online computer lab management systemOnline computer lab management system
Online computer lab management system
 
java mini project for college students
java mini project for college students java mini project for college students
java mini project for college students
 
TestingResume_3.6Yrs
TestingResume_3.6YrsTestingResume_3.6Yrs
TestingResume_3.6Yrs
 
Synopsis on online shopping by sudeep singh
Synopsis on online shopping by  sudeep singhSynopsis on online shopping by  sudeep singh
Synopsis on online shopping by sudeep singh
 
Project report On MSM (Mobile Shop Management)
Project report On MSM (Mobile Shop Management)Project report On MSM (Mobile Shop Management)
Project report On MSM (Mobile Shop Management)
 
Manjeet aem
Manjeet aemManjeet aem
Manjeet aem
 
News portal
News portalNews portal
News portal
 
mini_Project_SRS
mini_Project_SRSmini_Project_SRS
mini_Project_SRS
 
Microsoft Sharepoint 2013 : The Ultimate Enterprise Collaboration Platform
Microsoft Sharepoint 2013 : The Ultimate Enterprise Collaboration PlatformMicrosoft Sharepoint 2013 : The Ultimate Enterprise Collaboration Platform
Microsoft Sharepoint 2013 : The Ultimate Enterprise Collaboration Platform
 
Task tracking system
Task tracking systemTask tracking system
Task tracking system
 
Pulkit Sachdeva-Resume
Pulkit Sachdeva-ResumePulkit Sachdeva-Resume
Pulkit Sachdeva-Resume
 
Zarafa Repair is Possible in Few Clicks
Zarafa Repair is Possible in Few ClicksZarafa Repair is Possible in Few Clicks
Zarafa Repair is Possible in Few Clicks
 
Cv vipul valvi_java_developer
Cv vipul valvi_java_developerCv vipul valvi_java_developer
Cv vipul valvi_java_developer
 
A Software Engineering Project on Cyber cafe management
A Software Engineering Project on Cyber cafe managementA Software Engineering Project on Cyber cafe management
A Software Engineering Project on Cyber cafe management
 
Work experiences at Softcodeit
Work experiences at SoftcodeitWork experiences at Softcodeit
Work experiences at Softcodeit
 
Design & development of job portal system using joomla & its online reputatio...
Design & development of job portal system using joomla & its online reputatio...Design & development of job portal system using joomla & its online reputatio...
Design & development of job portal system using joomla & its online reputatio...
 
Goal setting
Goal settingGoal setting
Goal setting
 

Andere mochten auch

Monitoring web application response times, a new approach
Monitoring web application response times, a new approachMonitoring web application response times, a new approach
Monitoring web application response times, a new approachMark Friedman
 
ASP.NET Best Practices - Useful Tips from the Trenches
ASP.NET Best Practices - Useful Tips from the TrenchesASP.NET Best Practices - Useful Tips from the Trenches
ASP.NET Best Practices - Useful Tips from the TrenchesHabeeb Rushdan
 
Introduction to asp.net
Introduction to asp.netIntroduction to asp.net
Introduction to asp.netSHADAB ALI
 
Introduction to asp.net
Introduction to asp.netIntroduction to asp.net
Introduction to asp.netshan km
 
Writing clean code in C# and .NET
Writing clean code in C# and .NETWriting clean code in C# and .NET
Writing clean code in C# and .NETDror Helper
 
Concepts of Asp.Net
Concepts of Asp.NetConcepts of Asp.Net
Concepts of Asp.Netvidyamittal
 
DIWE - Coding HTML for Basic Web Designing
DIWE - Coding HTML for Basic Web DesigningDIWE - Coding HTML for Basic Web Designing
DIWE - Coding HTML for Basic Web DesigningRasan Samarasinghe
 
ASP.NET Presentation
ASP.NET PresentationASP.NET Presentation
ASP.NET Presentationdimuthu22
 
DIWE - Programming with JavaScript
DIWE - Programming with JavaScriptDIWE - Programming with JavaScript
DIWE - Programming with JavaScriptRasan Samarasinghe
 
Developing an aspnet web application
Developing an aspnet web applicationDeveloping an aspnet web application
Developing an aspnet web applicationRahul Bansal
 
DIWE - Introduction to Web Technologies
DIWE - Introduction to Web TechnologiesDIWE - Introduction to Web Technologies
DIWE - Introduction to Web TechnologiesRasan Samarasinghe
 
Introduction to ASP.NET
Introduction to ASP.NETIntroduction to ASP.NET
Introduction to ASP.NETRajkumarsoy
 
ASP.NET Tutorial - Presentation 1
ASP.NET Tutorial - Presentation 1ASP.NET Tutorial - Presentation 1
ASP.NET Tutorial - Presentation 1Kumar S
 

Andere mochten auch (18)

Monitoring web application response times, a new approach
Monitoring web application response times, a new approachMonitoring web application response times, a new approach
Monitoring web application response times, a new approach
 
ASP.NET Best Practices - Useful Tips from the Trenches
ASP.NET Best Practices - Useful Tips from the TrenchesASP.NET Best Practices - Useful Tips from the Trenches
ASP.NET Best Practices - Useful Tips from the Trenches
 
Introduction to asp.net
Introduction to asp.netIntroduction to asp.net
Introduction to asp.net
 
Introduction to asp.net
Introduction to asp.netIntroduction to asp.net
Introduction to asp.net
 
Asp dot net final (2)
Asp dot net   final (2)Asp dot net   final (2)
Asp dot net final (2)
 
DITEC - E-Commerce & ASP.NET
DITEC - E-Commerce & ASP.NETDITEC - E-Commerce & ASP.NET
DITEC - E-Commerce & ASP.NET
 
ASP.NET Core Security
ASP.NET Core SecurityASP.NET Core Security
ASP.NET Core Security
 
DITEC - Programming with Java
DITEC - Programming with JavaDITEC - Programming with Java
DITEC - Programming with Java
 
Writing clean code in C# and .NET
Writing clean code in C# and .NETWriting clean code in C# and .NET
Writing clean code in C# and .NET
 
Concepts of Asp.Net
Concepts of Asp.NetConcepts of Asp.Net
Concepts of Asp.Net
 
DIWE - Coding HTML for Basic Web Designing
DIWE - Coding HTML for Basic Web DesigningDIWE - Coding HTML for Basic Web Designing
DIWE - Coding HTML for Basic Web Designing
 
ASP.NET Presentation
ASP.NET PresentationASP.NET Presentation
ASP.NET Presentation
 
DIWE - Programming with JavaScript
DIWE - Programming with JavaScriptDIWE - Programming with JavaScript
DIWE - Programming with JavaScript
 
Developing an aspnet web application
Developing an aspnet web applicationDeveloping an aspnet web application
Developing an aspnet web application
 
DIWE - Introduction to Web Technologies
DIWE - Introduction to Web TechnologiesDIWE - Introduction to Web Technologies
DIWE - Introduction to Web Technologies
 
Introduction to ASP.NET
Introduction to ASP.NETIntroduction to ASP.NET
Introduction to ASP.NET
 
ASP.NET Tutorial - Presentation 1
ASP.NET Tutorial - Presentation 1ASP.NET Tutorial - Presentation 1
ASP.NET Tutorial - Presentation 1
 
Asp.net.
Asp.net.Asp.net.
Asp.net.
 

Ähnlich wie ASP.NET Presentation

ASP.Net | Sabin Saleem
ASP.Net | Sabin SaleemASP.Net | Sabin Saleem
ASP.Net | Sabin SaleemSaBin SaleEm
 
Web development concepts using microsoft technologies
Web development concepts using microsoft technologiesWeb development concepts using microsoft technologies
Web development concepts using microsoft technologiesHosam Kamel
 
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
 
Asp.Net Core MVC with Entity Framework
Asp.Net Core MVC with Entity FrameworkAsp.Net Core MVC with Entity Framework
Asp.Net Core MVC with Entity FrameworkShravan A
 
ASP, ASP.NET, JSP, COM/DCOM
ASP, ASP.NET, JSP, COM/DCOMASP, ASP.NET, JSP, COM/DCOM
ASP, ASP.NET, JSP, COM/DCOMAashish Jain
 
Programming is Fun with ASP.NET MVC
Programming is Fun with ASP.NET MVCProgramming is Fun with ASP.NET MVC
Programming is Fun with ASP.NET MVCIan Carnaghan
 
Asp.net With mvc handson
Asp.net With mvc handsonAsp.net With mvc handson
Asp.net With mvc handsonPrashant Kumar
 
ASP.NET MVC Fundamental
ASP.NET MVC FundamentalASP.NET MVC Fundamental
ASP.NET MVC Fundamentalldcphuc
 
Best of Microsoft Dev Camp 2015
Best of Microsoft Dev Camp 2015Best of Microsoft Dev Camp 2015
Best of Microsoft Dev Camp 2015Bluegrass Digital
 
JOB PORTALProject SummaryTitle JOB-PORT.docx
JOB PORTALProject SummaryTitle    JOB-PORT.docxJOB PORTALProject SummaryTitle    JOB-PORT.docx
JOB PORTALProject SummaryTitle JOB-PORT.docxchristiandean12115
 
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
 
ASP.NET MVC Presentation
ASP.NET MVC PresentationASP.NET MVC Presentation
ASP.NET MVC Presentationivpol
 

Ähnlich wie ASP.NET Presentation (20)

ASP.Net | Sabin Saleem
ASP.Net | Sabin SaleemASP.Net | Sabin Saleem
ASP.Net | Sabin Saleem
 
Web development concepts using microsoft technologies
Web development concepts using microsoft technologiesWeb development concepts using microsoft technologies
Web development concepts using microsoft technologies
 
Asp.net
Asp.netAsp.net
Asp.net
 
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
 
ASP.NET OVERVIEW
ASP.NET OVERVIEWASP.NET OVERVIEW
ASP.NET OVERVIEW
 
Asp.Net Core MVC with Entity Framework
Asp.Net Core MVC with Entity FrameworkAsp.Net Core MVC with Entity Framework
Asp.Net Core MVC with Entity Framework
 
ASP, ASP.NET, JSP, COM/DCOM
ASP, ASP.NET, JSP, COM/DCOMASP, ASP.NET, JSP, COM/DCOM
ASP, ASP.NET, JSP, COM/DCOM
 
Programming is Fun with ASP.NET MVC
Programming is Fun with ASP.NET MVCProgramming is Fun with ASP.NET MVC
Programming is Fun with ASP.NET MVC
 
ASP.pptx
ASP.pptxASP.pptx
ASP.pptx
 
Session 1
Session 1Session 1
Session 1
 
Asp.net mvc
Asp.net mvcAsp.net mvc
Asp.net mvc
 
Asp.net With mvc handson
Asp.net With mvc handsonAsp.net With mvc handson
Asp.net With mvc handson
 
Beginners introduction to asp.net
Beginners introduction to asp.netBeginners introduction to asp.net
Beginners introduction to asp.net
 
ASP.NET MVC Fundamental
ASP.NET MVC FundamentalASP.NET MVC Fundamental
ASP.NET MVC Fundamental
 
Best of Microsoft Dev Camp 2015
Best of Microsoft Dev Camp 2015Best of Microsoft Dev Camp 2015
Best of Microsoft Dev Camp 2015
 
JOB PORTALProject SummaryTitle JOB-PORT.docx
JOB PORTALProject SummaryTitle    JOB-PORT.docxJOB PORTALProject SummaryTitle    JOB-PORT.docx
JOB PORTALProject SummaryTitle JOB-PORT.docx
 
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...
 
Asp.netrole
Asp.netroleAsp.netrole
Asp.netrole
 
SynapseIndia asp.net2.0 ajax Development
SynapseIndia asp.net2.0 ajax DevelopmentSynapseIndia asp.net2.0 ajax Development
SynapseIndia asp.net2.0 ajax Development
 
ASP.NET MVC Presentation
ASP.NET MVC PresentationASP.NET MVC Presentation
ASP.NET MVC Presentation
 

Kürzlich hochgeladen

Q4-PPT-Music9_Lesson-1-Romantic-Opera.pptx
Q4-PPT-Music9_Lesson-1-Romantic-Opera.pptxQ4-PPT-Music9_Lesson-1-Romantic-Opera.pptx
Q4-PPT-Music9_Lesson-1-Romantic-Opera.pptxlancelewisportillo
 
Millenials and Fillennials (Ethical Challenge and Responses).pptx
Millenials and Fillennials (Ethical Challenge and Responses).pptxMillenials and Fillennials (Ethical Challenge and Responses).pptx
Millenials and Fillennials (Ethical Challenge and Responses).pptxJanEmmanBrigoli
 
How to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERPHow to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERPCeline George
 
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTSGRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTSJoshuaGantuangco2
 
Oppenheimer Film Discussion for Philosophy and Film
Oppenheimer Film Discussion for Philosophy and FilmOppenheimer Film Discussion for Philosophy and Film
Oppenheimer Film Discussion for Philosophy and FilmStan Meyer
 
TEACHER REFLECTION FORM (NEW SET........).docx
TEACHER REFLECTION FORM (NEW SET........).docxTEACHER REFLECTION FORM (NEW SET........).docx
TEACHER REFLECTION FORM (NEW SET........).docxruthvilladarez
 
EmpTech Lesson 18 - ICT Project for Website Traffic Statistics and Performanc...
EmpTech Lesson 18 - ICT Project for Website Traffic Statistics and Performanc...EmpTech Lesson 18 - ICT Project for Website Traffic Statistics and Performanc...
EmpTech Lesson 18 - ICT Project for Website Traffic Statistics and Performanc...liera silvan
 
ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4MiaBumagat1
 
Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17Celine George
 
Active Learning Strategies (in short ALS).pdf
Active Learning Strategies (in short ALS).pdfActive Learning Strategies (in short ALS).pdf
Active Learning Strategies (in short ALS).pdfPatidar M
 
ClimART Action | eTwinning Project
ClimART Action    |    eTwinning ProjectClimART Action    |    eTwinning Project
ClimART Action | eTwinning Projectjordimapav
 
4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptx4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptxmary850239
 
ENG 5 Q4 WEEk 1 DAY 1 Restate sentences heard in one’s own words. Use appropr...
ENG 5 Q4 WEEk 1 DAY 1 Restate sentences heard in one’s own words. Use appropr...ENG 5 Q4 WEEk 1 DAY 1 Restate sentences heard in one’s own words. Use appropr...
ENG 5 Q4 WEEk 1 DAY 1 Restate sentences heard in one’s own words. Use appropr...JojoEDelaCruz
 
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)lakshayb543
 
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
 
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdfGrade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdfJemuel Francisco
 
Dust Of Snow By Robert Frost Class-X English CBSE
Dust Of Snow By Robert Frost Class-X English CBSEDust Of Snow By Robert Frost Class-X English CBSE
Dust Of Snow By Robert Frost Class-X English CBSEaurabinda banchhor
 
ROLES IN A STAGE PRODUCTION in arts.pptx
ROLES IN A STAGE PRODUCTION in arts.pptxROLES IN A STAGE PRODUCTION in arts.pptx
ROLES IN A STAGE PRODUCTION in arts.pptxVanesaIglesias10
 

Kürzlich hochgeladen (20)

Q4-PPT-Music9_Lesson-1-Romantic-Opera.pptx
Q4-PPT-Music9_Lesson-1-Romantic-Opera.pptxQ4-PPT-Music9_Lesson-1-Romantic-Opera.pptx
Q4-PPT-Music9_Lesson-1-Romantic-Opera.pptx
 
Millenials and Fillennials (Ethical Challenge and Responses).pptx
Millenials and Fillennials (Ethical Challenge and Responses).pptxMillenials and Fillennials (Ethical Challenge and Responses).pptx
Millenials and Fillennials (Ethical Challenge and Responses).pptx
 
How to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERPHow to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERP
 
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTSGRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
 
Oppenheimer Film Discussion for Philosophy and Film
Oppenheimer Film Discussion for Philosophy and FilmOppenheimer Film Discussion for Philosophy and Film
Oppenheimer Film Discussion for Philosophy and Film
 
TEACHER REFLECTION FORM (NEW SET........).docx
TEACHER REFLECTION FORM (NEW SET........).docxTEACHER REFLECTION FORM (NEW SET........).docx
TEACHER REFLECTION FORM (NEW SET........).docx
 
EmpTech Lesson 18 - ICT Project for Website Traffic Statistics and Performanc...
EmpTech Lesson 18 - ICT Project for Website Traffic Statistics and Performanc...EmpTech Lesson 18 - ICT Project for Website Traffic Statistics and Performanc...
EmpTech Lesson 18 - ICT Project for Website Traffic Statistics and Performanc...
 
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
 
ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4
 
Paradigm shift in nursing research by RS MEHTA
Paradigm shift in nursing research by RS MEHTAParadigm shift in nursing research by RS MEHTA
Paradigm shift in nursing research by RS MEHTA
 
Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17
 
Active Learning Strategies (in short ALS).pdf
Active Learning Strategies (in short ALS).pdfActive Learning Strategies (in short ALS).pdf
Active Learning Strategies (in short ALS).pdf
 
ClimART Action | eTwinning Project
ClimART Action    |    eTwinning ProjectClimART Action    |    eTwinning Project
ClimART Action | eTwinning Project
 
4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptx4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptx
 
ENG 5 Q4 WEEk 1 DAY 1 Restate sentences heard in one’s own words. Use appropr...
ENG 5 Q4 WEEk 1 DAY 1 Restate sentences heard in one’s own words. Use appropr...ENG 5 Q4 WEEk 1 DAY 1 Restate sentences heard in one’s own words. Use appropr...
ENG 5 Q4 WEEk 1 DAY 1 Restate sentences heard in one’s own words. Use appropr...
 
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
 
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
 
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdfGrade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
 
Dust Of Snow By Robert Frost Class-X English CBSE
Dust Of Snow By Robert Frost Class-X English CBSEDust Of Snow By Robert Frost Class-X English CBSE
Dust Of Snow By Robert Frost Class-X English CBSE
 
ROLES IN A STAGE PRODUCTION in arts.pptx
ROLES IN A STAGE PRODUCTION in arts.pptxROLES IN A STAGE PRODUCTION in arts.pptx
ROLES IN A STAGE PRODUCTION in arts.pptx
 

ASP.NET Presentation

  • 1. JATIYA KABI KAZI NAZRUL ISLAM UNIVERSITY Presentation On Submitted to Mr. Tushar Kanti Saha Lecturer Deprt of CSE, JKKNIU Submitted By Rasel khan Roll: 11102027 Session: 2010-2011 Dept Of CSE
  • 2. ASP.NET OVERVIEW  Introduction & History  Why use ASP.NET, Some characteristics & with Component  Steps for developing a web based application and how to work request with response.  Working with ASP.NET MVC Framework.  How to work HTTP Fundamentals.  ASP.NET web application Routing.  ASP.NET IIS & how to create virtual directory.
  • 3. ASP.NET mean is Active Server Pages . It is a server-side Web application framework designed for Web development to produce dynamic Web pages .It was developed by Microsoft to allow programmers to build , • Dynamic web sites, • Web applications • Web services
  • 4. • The latest version of ASP is known as ASP.NET • Visual Studio .NET is a developer application used to create ASP.NET Web applications • There are two main types of Web resources created with ASP.NET applications – Web Forms are ASP.NET pages within an ASP.NET application – Web Services are ASP.NET Web pages that contain publicly exposed code so that other applications can interact with them – Web Services are identified with the file extension .asmx
  • 5. ASP.NET 1.0 was released on January 5, 2002 as part of version 1.0 of the .NET Framework. Scott Guthrie became the product unit manager for ASP.NET, and development continued apace, with version 1.1 being released on April 24, 2003 as a part of Windows Server 2003. This release focused on improving ASP.NET's support for mobile devices.
  • 6.  Improved Performance and Scalability.  Compiled Execution, Rich Output Caching, Web Farm Session State.  Enhanced Reliability.  Memory Leak, Dead Lock, and Crash Protection  Easy Deployment.  No Touch" Application Deployment, Dynamic Update of Running Application, Easy Migration Path  New Application Models.  XML Web Services  Developer Productivity.  Easy Programming Model, Flexible Language Options, Rich Class Framework.
  • 7.  Code-behind model  It is recommended by Microsoft for dealing with dynamic program code to use the code-behind model, which places this code in a separate file or in a specially designated script tag  User  controls ASP.NET supports creating reusable components through the creation of User Controls  Rendering technique  ASP.NET uses a visited composites rendering technique. During compilation, the template (.aspx) file is compiled into initialization code which builds a control tree (the composite) representing the original template
  • 8. • Compiled code  Code written in ASP.NET is compile and not interpreted. • Enriched tool support  ASP.NET applications using visual studio • Power and flexibility  ASP.NET applications are based on the CLR • Simplicity  ASP.NET enables you to build user interfaces that separate application logic from presentation content • Manageability  ASP.NET provides a number of options in providing the above facilities
  • 9.  Server control Respond to users events by running event procedures on the server.  HTML control Represent the standard visual elements provided in HTML  Data control Provide a way to connect to perform commands on and retrieve data from SQL , OL ,databases and XML data files  System components Provide access to various system level events that occur on the server
  • 10. Step 1 – Step 2 Step 3 Step 4 Step 5 Step 6 Step 7 – – – – – – Create Local Folders for Your Web Project Create a Blank Solution Add a Web Site to Your Solution Add a Class Library (Optional) Check Your Solution Structure Check Your Local Folder Structure Add Your Solution to Source Control
  • 11. Web Server Web Browser Get default.aspx 1. Client Initiates 2. Communications With page request Display page Server response with pages 1. Process request 2. Execute server slide code 3. Store session data 4. Send result response
  • 12.
  • 13.
  • 14. ASP.NET MVC Model View Controller (MVC) applications by using the ASP.NET framework
  • 15. WHAT IS ASP.NET MVC? Saying simply, ASP.NET MVC is a new framework from Microsoft that sits over standard ASP.NET engine. ASP.NET MVC ASP.NET
  • 16. ASP.NET MVC Features 1. Clear separation of logic: Model, View, Controller 2. Test-Driven Development (TDD) 3. Full control over HTML and JavaScript 4. Friendly URLs
  • 17. MODEL + VIEW + CONTROLLER = MVC ASP.NET MVC provides an alternative to the ASP.NET “Web Forms” pattern for creating MVC-based Web applications. Views display the application's user interface (UI). Typically, this UI is created from the model data. Model objects implement the logic for the application's data domain. Often, model objects retrieve and store the app state in a database. Model View Controller Controllers handle user interaction, work with the model, and select a view to render that displays UI
  • 18. Test-Driven Development (TDD) Since the UI is completely separated from the business logic, it’s now easy to write Unit Tests for the ASP.NET MVC application. Unit Tests that cover User Actions and Data Model User Interface Controller Data Objects
  • 19. Full control over HTML & JS In ASP.NET MVC, designed HTML & JS pages are not more messed up with “postbacks” and “ViewStates”, which is specific for “Web-forms” pattern. <input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE" value="/wEPaA8FDzhjYjBhZjA0ODYyMTM2NBgGBR5fX0NvbnRyb2xzUmVxdWlyZVBvc3RCYWNr S2V5X18WAQUhY3RsMDAkaGVhZGVyJHVjTWFpbk1lbnUkc2VhcmNoQnRuBTdjdGwwMCRNYWl uQ29udGVudCRycHRWaWRlbyRjdGwwMyRwcmVzZW50YXRpb25DYXJkJG11bHRp" /> <script type="text/javascript"> //<![CDATA[ var theForm = document.forms['aspnetForm']; function __doPostBack(eventTarget, eventArgument) { if (!theForm.onsubmit || (theForm.onsubmit() != false)) { theForm.__EVENTTARGET.value = eventTarget; theForm.__EVENTARGUMENT.value = eventArgument; theForm.submit(); } } //]]> </script>
  • 20. Friendly URLs MVC binds web paths to the logical URLs rather than to the physical files. Physical location: C:InetpubwwwrootWebSiteProducts.aspx ASP.NET style: http://www.website.com/Products.aspx?name=Me at MVC style: http://www.website.com/Products/Meat
  • 21. HOW DOES ASP.NET MVC LOOKS LIKE? ASP.NET MVC installs a new type of web project into VS2008.
  • 22. A newly created project has an ASP.NET MVC specific directory structure. App_Data folder is the physical store for data. Content folder keeps files such as scripts, CSS, images, and so on. Controllers folder is the location for controllers. The MVC framework requires the names of all controllers to end with "Controller"—for example, HomeController, LoginController, or ProductController. Models stores classes that handle application business logic. Scripts folder is for script files that support the application. By default, this folder contains AJAX script files and the JQuery library. Views is the recommended location for views. Views use .aspx, .ascx, and .master files, in addition to any other files that are related to rendering views.
  • 23. ASP.NET MVC supports pure MVC pattern, the same development pattern Rails are based on. The advantages of ASP.NET MVC applications: 1. It makes it easier to manage complexity by dividing an application into the model, the view, and the controller. 2. It does not use view state or server-based forms. 3. It uses a Front Controller pattern that processes Web application requests through a single controller. This enables you to design an application that supports a rich routing infrastructure with friendly URLs. 4. It provides better support for test-driven development (TDD). 5. It works well for Web applications that are supported by large teams of developers and Web designers who need a high degree of control over the application behavior.
  • 24.  http://www.asp.net/mvc - official site  http://weblogs.asp.net/scottgu/archive/2007/11/13/asp-net-mvcframework-part-1.aspx - development basics on ASP.NET MVC  http://weblogs.asp.net/scottgu/archive/2007/12/03/asp-net-mvcframework-part-2-url-routing.aspx - URL routing used in ASP.NET MVC  http://weblogs.asp.net/scottgu/archive/2007/12/06/asp-net-mvcframework-part-3-passing-viewdata-from-controllers-to-views.aspx interaction between Controllers and Views  http://weblogs.asp.net/scottgu/archive/2007/12/09/asp-net-mvcframework-part-4-handling-form-edit-and-post-scenarios.aspx - managing form input data
  • 25. ASP.NET Web API and HTTP Fundamentals
  • 26. CRAMMING YOUR BRAINS WITH HTTP & ASP.NET WEB API • HTTP Fundamentals via Web API • Dependency Resolver • HTTP Messages • URIs • HTTP.SYS • Routing • IIS 101 • Verbs • HTTP compression • Controllers and Actions • Persisted Connections • Status Codes • Web API Self Hosting • HttpRequestMessage HttpResponseMessage • Error Handling • Content Negotiation • Media Type Formatters • OData • Validations • • Hosting More HTTP and Web API • Caching • Concurrency • Security • Streaming • WebSockets & SignalR 26
  • 27. WHY IS HTTP IMPORTANT?  HTTP is a first class application layer protocol  Unlike other protocols it was created to support a single information system  That system happened to be the largest and main information system of the human race: 27
  • 28. NO REALLY, WHY? Today's systems face new challenges:  Broader reach of clients
  • 29. What About ASP.NET Web API? • The .NET platform never had a first class framework for HTTP-based services • WCF was created as a SOAP-based framework and never really matured to support HTTP 29
  • 30. THE HISTORY OF ASP.NET WEB API 6 Preview Versions WCF Web API on CodePlex WCF WebHttp Binding (.NET 4) ASP.NET Web API 4 Release ASP.NET is Open Source ASP.NET Web API 2 Release Candidate ASP.NET Web API (Beta) 30
  • 31. HTTP Messages 101  HTTP is a first class application protocol:  Widely supported across platforms and devices  Scalable  Simple  Uses the request-response messaging pattern  Define resource-based semantics and not RPC (Remote Procedure Call) or methods 31
  • 32. HTTP REQUEST MESSAGES GET http://localhost:2300/api/agents/Bond HTTP/1.1 Accept: text/html, application/xhtml+xml, */* Accept-Language: en-US,en;q=0.7,he;q=0.3 User-Agent: Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.2; WOW64; Trident/6.0) Accept-Encoding: gzip, deflate Host: localhost:2300 DNT: 1 Connection: Keep-Alive 32
  • 33. HTTP RESPONSE MESSAGES HTTP/1.1 200 OK Cache-Control: public, max-age=300 Content-Type: application/json; charset=utf-8 ETag: "1" Server: Microsoft-IIS/8.0 X-AspNet-Version: 4.0.30319 Date: Mon, 19 Nov 2012 17:49:40 GMT Content-Length: 142 { "Id": "Bond", "FullName": "James Bond", "Alias": "007", "Version": 1, "Image": "http://localhost:2300/api/agents/Bond.jpg" } 33
  • 34. URIS • HTTP is not an RPC protocol • HTTP uses URIs to identify resources over the network • An HTTP URI has the following basic structure: http://theagency.com:8080/agents?id=1 Schema Host Port Absolute Path Query 34
  • 35. CLEAN URLS AND ASP.NET  Using clean URLs can be a problem with IIS  IIS needs extensions to map requests to handlers  Without extensions, IIS is lost  ASP.NET Routing to the rescue with UrlRoutingModule  It’s all about patterns… and mapping them to handlers  The starting point of MVC, Dynamic Data, and Web API  System.Web.Routing.RouteTable.Routes.MapHttpRoute RouteTable.Routes.MapHttpRoute( name: "DefaultApi", routeTemplate: "api/{controller}/{id}", defaults: new { id = RouteParameter.Optional } ); 35
  • 36. ASP.NET WEB API - ROUTING 36
  • 37. Routing with attributes  Why attributes over convention?  Child (sub) resources  Multiple type of parameters or return values  Versioning of actions and controllers  Start by enabling attribute routing  config.MapHttpAttributeRoutes(); [RoutePrefix("api/agents/{agentId}")] public class ObservationsController : ApiController { // GET api/agents/bond/observations [HttpGet("observations/{date}")] public Observation Get(string agentId, DateTime date) { ... } }
  • 38. Verbs • HTTP defines a set of Methods or Verbs that add an action-like semantics to requests • Verbs are defined as the first segment of • the request-line: GET http://localhost:4392/travelers/1 HTTP/1.1 • There are eight verbs defined in HTTP 1.1: GET POST PUT DELETE HEAD OPTIONS TRACE CONNECT 38
  • 39. 3, 2, 1, Actions! • Actions are matched by HTTP verb names and the existence of parameters public class ProductsController : ApiController { public IEnumerable<Product> GetProducts() {...} public Product GetProductById(int id) {...} public HttpResponseMessage PostProduct(Product product) {...} } GET api/products GET api/products/42 POST api/products DELETE api/products/42
  • 40. Status Codes  Status codes describe the result of the server’s effort to satisfy the request  Passed in the response's status-line as three digit alongside a textual description called reason phrase  HTTP has five different categories of status-codes:      1xx – Informational 2xx – Success 3xx – Redirection 4xx – Client Error 5xx – Server Error (100 / 101) (200 – 206) (300 – 307) (400 – 417) (500 – 505)
  • 42.  Returning an HttpResponseMessage allows more control over the response, including:    Status code HTTP headers Entity body public HttpResponseMessage CreateAgent(Agent agent) { agent = _repository.Add(agent); var response = Request.CreateResponse<Agent>(HttpStatusCode.Created, agent); response.Headers.Location = GetAgentLocation(agent.Id); return response; } 42
  • 43. Error Handling • In HTTP services errors are handled by ▫ Returning an appropriate status code ▫ Returning an entity body explaining the error (when applicable) • Web API allows you to handle exceptions by ▫ Return an HttpResponseMessage with appropriate status code (404, 500 …) ▫ Throw an HttpResponseException ▫ Create a general exception handler by using Filters 43
  • 44. HTTP defines a process to best match the server’s response to the client’s expectation  Negotiation can be done using:   Headers: Accept, Accept- Language, Accept- Charset, Accept-Encoding  URI: File extensions (.jpeg, .html), host-name: (com, org), path and query 44
  • 45. ASP.NET, IIS & how to create virtual directory
  • 46. SESSION OBJECTIVES • • • • • • ASP.NET Benefit How Does ASP.NET Work? IIS Creating a Virtual Directory Web Sharing the Project Folder Deleting a Web Project
  • 47. HOW DOES ASP.NET WORK? • Requests an HTML file, the server returns the file • Requests an ASP.NET file, IIS passes the request to the ASP.NET engine on the server • The ASP.NET engine reads the file, line by line, and executes the scripts in the file • ASP.NET file is returned to the browser as plain HTML
  • 48.  Separation of Code from HTML  Graphical Development Environment  Update files while the server is running!  Support for compiled languages  State management
  • 49. IIS – Internet Information Services • Internet Information Service • IIS (Internet Information Services) is Microsoft's Internet server • IIS comes as a free component with Windows servers • IIS is also a part of Windows 2000 and XP Professional
  • 50.     Start, Settings, Control Panel, Administrative Tools, Internet Services Manager Expand node for computer and default Web site Right-click Default Web site icon, select New, Virtual Directory In Virtual Directory Creation Wizard enter your project folder name as the alias and enter the folder and path
  • 51. Web Sharing the Project Folder  Select the Project folder in My Computer  Right-click, select Properties, Web Sharing, activate Share This Folder  In Edit Alias dialog click OK
  • 52. Deleting a Web Project  Project in IIS Virtual Directory  Delete the directory  Project in Web Shared Folder  “Unshare” it from Properties dialog  Either Reboot Computer or Stop and Restart IIS  Delete Folder

Hinweis der Redaktion

  1. Additionally supports constraints (type, min/max restriction, regex, and range), optional and default values, ordering, and extensibility.http://www.asp.net/web-api/overview/web-api-routing-and-actions/attribute-routing-in-web-api-2