SlideShare a Scribd company logo
1 of 32
ASP.NET 4.0
Julie Iskander
MSC. Communication and Electronics
Lecture Outlines
 Handlers and Modules
 Deploying web application
HttpHandlers and
HttpModules
HttpModules
 Simple classes that can plug
  themselves into the request-
  processing pipeline
 Attaching to events thrown by the
  application.
 Similar to Global.asax
Global.asax                 HttpModules

 Store global state           Store global state
  between requests              between requests
 Respond to application-      Respond to application-
  wide events                   wide events
                               A separate
 Specific application
                                assembly, that can be
                                referenced by any
                                application
                               Implements generic
                                functionality that’s useful
                                between different
                                applications.

Global.asax vs. HttpModules
Creating an HTTPModule
 Create a class implementing
  System.Web.IHttpModule interface
 Requires to implement : Init and
  Dispose
    ◦ Init:
       Input parameter: HttpApplication context
         Access current application context
       To implement HttpModule functionality
       Used to wire-up different events that fire during
        request processing
Creating an HTTPModule
    ◦ Dispose:
      called once when the application terminates.
      Application terminates and reinitializes when:
        The application or IIS restarts,
        The Web.config configuration file or a dependent
         assembly is modified.

   Configure module in web.config
Convert from an HTML to an aspx page
ASP.NET features handled by
modules:
 Output Caching
 Session State
 Windows Authentication
 Forms Authentication
 Passport Authentication
 Role manager
 Anonymous Identification
 Profile
 ErrorHandlerModule
HttpHandlers
 The last stop for incoming HTTP
  Request
 The point in the request processing
  pipeline that is responsible for serving
  up the requested content
 Mapped to a specific file extension
  (.aspx, .html,.jpg…………)
 Unlike modules, only one handler is
  used to process a request.
Built-in HTTP Handlers

Handler                         Description
ASP.NET page handler (*.aspx)   The default HTTP handler for all
                                pages.
Web service handler (*.asmx)    The default HTTP handler for Web
                                services
Generic Web handler (*.ashx)    The default HTTP handler for all
                                Web handlers that do not have a
                                UI and include @WebHandler
                                directive
Creating HttpHandlers
 Using generic handler .ashx
 Mapping the HttpHandler to a custom
  file extension.
Generic HttpHandlers
 Add new item Generic Handler
  (*.ashx)
 Class implements IHttpHandler
    ◦ ProcessRequest:
      Actually process incoming HTTP request.
      Input argument:
        HTTPContext object has access to all objects of the
         current HTTP context as
         response, request, user, profile, ……..
    ◦ IsReusable:
      Property to let ASP.NET know whether incoming
       HTTP requests can reuse the same instance of the
       HttpHandler
Convert from an HTML to an aspx page
HttpHandlers to custom file
extensions
 Create a class that inherit from
  IHttpHandler, add it to App_code or in
  a separate library project to be added
  as an assembly
 Implement the 2 methods same as
  previously
 Add configuration to web.config
Convert from an HTML to an aspx page
Deployment
Publish on Local IIS
 Must run Visual Studio as
  Administration
 Install all needed IIS components
 Reinstall ASP.NET if needed
 Make sure application pool is set to
  .NET Framework 4.0
 Add user(with permissions to db and
  files) to application pool identity
Publish on Local IIS
 Use Copy Website
 Use Publish Website
Important Note
   To avoid problems with configuration
    in machine root web.config
    ◦ Add <clear /> in all providers
   To avoid problems with users and
    roles in multiple applications add
    applicationName attribute to all
    providers
Reading Assignment #8
   Chapter 26 – Professional ASP.NET 4
    in CS and VB
REFERENCES

 [1] Beginning ASP.NET 4 In C# 2010, Matthew
  Macdonald, Apress
 [2] Web Application Architecture
  Principles, Protocols And Practices, Leon Shklar
  And Richard Rosen, Wiley
 [3] Professional AS P.NE T 4 In C# And VB, Bill
  Evjen, Scott Hanselman And Devin Rader, Wiley
 [4] Pro ASP.NET In C# 2010, Fourth
  Edition,matthew Macdonald, Adam Freeman, And
  Mario Szpuszta, Apress

More Related Content

What's hot

Creating REST Webservice With NetBeans
Creating REST Webservice With NetBeansCreating REST Webservice With NetBeans
Creating REST Webservice With NetBeansNeil Ghosh
 
Cejv659 week09 glassfish-s14
Cejv659 week09 glassfish-s14Cejv659 week09 glassfish-s14
Cejv659 week09 glassfish-s14Ken Fogel
 
Advanced SharePoint Web Part Development
Advanced SharePoint Web Part DevelopmentAdvanced SharePoint Web Part Development
Advanced SharePoint Web Part DevelopmentRob Windsor
 
ASP.NET Page Life Cycle
ASP.NET Page Life CycleASP.NET Page Life Cycle
ASP.NET Page Life CycleAbhishek Sur
 
Introducing asp.net core mvc web application
Introducing asp.net core mvc web applicationIntroducing asp.net core mvc web application
Introducing asp.net core mvc web applicationJoy Sarker
 
The complete ASP.NET (IIS) Tutorial with code example in power point slide show
The complete ASP.NET (IIS) Tutorial with code example in power point slide showThe complete ASP.NET (IIS) Tutorial with code example in power point slide show
The complete ASP.NET (IIS) Tutorial with code example in power point slide showSubhas Malik
 
Lyudmila Zharova: Developing Solutions for SharePoint 2010 Using the Client O...
Lyudmila Zharova: Developing Solutions for SharePoint 2010 Using the Client O...Lyudmila Zharova: Developing Solutions for SharePoint 2010 Using the Client O...
Lyudmila Zharova: Developing Solutions for SharePoint 2010 Using the Client O...SharePoint Saturday NY
 
Introduction to ASP.Net MVC
Introduction to ASP.Net MVCIntroduction to ASP.Net MVC
Introduction to ASP.Net MVCSagar Kamate
 
Integrating SharePoint 2010 and Visual Studio Lightswitch
Integrating SharePoint 2010 and Visual Studio LightswitchIntegrating SharePoint 2010 and Visual Studio Lightswitch
Integrating SharePoint 2010 and Visual Studio LightswitchRob Windsor
 
Asp.Net Mvc
Asp.Net MvcAsp.Net Mvc
Asp.Net Mvcmicham
 
Data controls ppt
Data controls pptData controls ppt
Data controls pptIblesoft
 
SharePoint 2010 Client-side Object Model
SharePoint 2010 Client-side Object ModelSharePoint 2010 Client-side Object Model
SharePoint 2010 Client-side Object ModelPhil Wicklund
 
SharePoint 2010 Application Development Overview
SharePoint 2010 Application Development OverviewSharePoint 2010 Application Development Overview
SharePoint 2010 Application Development OverviewRob Windsor
 
Msdn Workflow Services And Windows Server App Fabric
Msdn Workflow Services And Windows Server App FabricMsdn Workflow Services And Windows Server App Fabric
Msdn Workflow Services And Windows Server App FabricJuan Pablo
 

What's hot (20)

Web controls
Web controlsWeb controls
Web controls
 
Creating REST Webservice With NetBeans
Creating REST Webservice With NetBeansCreating REST Webservice With NetBeans
Creating REST Webservice With NetBeans
 
Cejv659 week09 glassfish-s14
Cejv659 week09 glassfish-s14Cejv659 week09 glassfish-s14
Cejv659 week09 glassfish-s14
 
Asp.net
Asp.netAsp.net
Asp.net
 
Advanced Asp.Net Concepts And Constructs
Advanced Asp.Net Concepts And ConstructsAdvanced Asp.Net Concepts And Constructs
Advanced Asp.Net Concepts And Constructs
 
Advanced SharePoint Web Part Development
Advanced SharePoint Web Part DevelopmentAdvanced SharePoint Web Part Development
Advanced SharePoint Web Part Development
 
ASP.NET Page Life Cycle
ASP.NET Page Life CycleASP.NET Page Life Cycle
ASP.NET Page Life Cycle
 
Introducing asp.net core mvc web application
Introducing asp.net core mvc web applicationIntroducing asp.net core mvc web application
Introducing asp.net core mvc web application
 
The complete ASP.NET (IIS) Tutorial with code example in power point slide show
The complete ASP.NET (IIS) Tutorial with code example in power point slide showThe complete ASP.NET (IIS) Tutorial with code example in power point slide show
The complete ASP.NET (IIS) Tutorial with code example in power point slide show
 
Lyudmila Zharova: Developing Solutions for SharePoint 2010 Using the Client O...
Lyudmila Zharova: Developing Solutions for SharePoint 2010 Using the Client O...Lyudmila Zharova: Developing Solutions for SharePoint 2010 Using the Client O...
Lyudmila Zharova: Developing Solutions for SharePoint 2010 Using the Client O...
 
Introduction to ASP.Net MVC
Introduction to ASP.Net MVCIntroduction to ASP.Net MVC
Introduction to ASP.Net MVC
 
ASP.NET 4.0 Roadmap
ASP.NET 4.0 RoadmapASP.NET 4.0 Roadmap
ASP.NET 4.0 Roadmap
 
Integrating SharePoint 2010 and Visual Studio Lightswitch
Integrating SharePoint 2010 and Visual Studio LightswitchIntegrating SharePoint 2010 and Visual Studio Lightswitch
Integrating SharePoint 2010 and Visual Studio Lightswitch
 
Angular introduction basic
Angular introduction basicAngular introduction basic
Angular introduction basic
 
Asp.Net Mvc
Asp.Net MvcAsp.Net Mvc
Asp.Net Mvc
 
Data controls ppt
Data controls pptData controls ppt
Data controls ppt
 
SharePoint 2010 Client-side Object Model
SharePoint 2010 Client-side Object ModelSharePoint 2010 Client-side Object Model
SharePoint 2010 Client-side Object Model
 
SharePoint 2010 Application Development Overview
SharePoint 2010 Application Development OverviewSharePoint 2010 Application Development Overview
SharePoint 2010 Application Development Overview
 
Msdn Workflow Services And Windows Server App Fabric
Msdn Workflow Services And Windows Server App FabricMsdn Workflow Services And Windows Server App Fabric
Msdn Workflow Services And Windows Server App Fabric
 
ASP.NET Lecture 6
ASP.NET Lecture 6ASP.NET Lecture 6
ASP.NET Lecture 6
 

Viewers also liked

.Net 4.0 system.runtime.caching
.Net 4.0 system.runtime.caching.Net 4.0 system.runtime.caching
.Net 4.0 system.runtime.cachingLarry Nung
 
ASP.NET 07 - Site Navigation
ASP.NET 07 - Site NavigationASP.NET 07 - Site Navigation
ASP.NET 07 - Site NavigationRandy Connolly
 
Enterprise application integration
Enterprise application integrationEnterprise application integration
Enterprise application integrationGoa App
 
How Sentiment Analysis works
How Sentiment Analysis worksHow Sentiment Analysis works
How Sentiment Analysis worksCJ Jenkins
 
Introduction to Sentiment Analysis
Introduction to Sentiment AnalysisIntroduction to Sentiment Analysis
Introduction to Sentiment AnalysisJaganadh Gopinadhan
 
Opinion Mining Tutorial (Sentiment Analysis)
Opinion Mining Tutorial (Sentiment Analysis)Opinion Mining Tutorial (Sentiment Analysis)
Opinion Mining Tutorial (Sentiment Analysis)Kavita Ganesan
 
project sentiment analysis
project sentiment analysisproject sentiment analysis
project sentiment analysissneha penmetsa
 

Viewers also liked (10)

ASP.NET Lecture 7
ASP.NET Lecture 7ASP.NET Lecture 7
ASP.NET Lecture 7
 
.Net 4.0 system.runtime.caching
.Net 4.0 system.runtime.caching.Net 4.0 system.runtime.caching
.Net 4.0 system.runtime.caching
 
ASP.NET 07 - Site Navigation
ASP.NET 07 - Site NavigationASP.NET 07 - Site Navigation
ASP.NET 07 - Site Navigation
 
Computer in hindi I
Computer in hindi IComputer in hindi I
Computer in hindi I
 
Enterprise application integration
Enterprise application integrationEnterprise application integration
Enterprise application integration
 
How Sentiment Analysis works
How Sentiment Analysis worksHow Sentiment Analysis works
How Sentiment Analysis works
 
Introduction to Sentiment Analysis
Introduction to Sentiment AnalysisIntroduction to Sentiment Analysis
Introduction to Sentiment Analysis
 
Opinion Mining Tutorial (Sentiment Analysis)
Opinion Mining Tutorial (Sentiment Analysis)Opinion Mining Tutorial (Sentiment Analysis)
Opinion Mining Tutorial (Sentiment Analysis)
 
Asp.net.
Asp.net.Asp.net.
Asp.net.
 
project sentiment analysis
project sentiment analysisproject sentiment analysis
project sentiment analysis
 

Similar to ASP.NET lecture 8

Similar to ASP.NET lecture 8 (20)

Chapter 5
Chapter 5Chapter 5
Chapter 5
 
Aspdotnet
AspdotnetAspdotnet
Aspdotnet
 
Zend Framework Quick Start Walkthrough
Zend Framework Quick Start WalkthroughZend Framework Quick Start Walkthrough
Zend Framework Quick Start Walkthrough
 
Scalable Web Architectures and Infrastructure
Scalable Web Architectures and InfrastructureScalable Web Architectures and Infrastructure
Scalable Web Architectures and Infrastructure
 
Philly Tech Fest Iis
Philly Tech Fest IisPhilly Tech Fest Iis
Philly Tech Fest Iis
 
Http pipeline
Http pipelineHttp pipeline
Http pipeline
 
Http pipeline
Http pipelineHttp pipeline
Http pipeline
 
Understanding ASP.NET Under The Cover - Miguel A. Castro
Understanding ASP.NET Under The Cover - Miguel A. CastroUnderstanding ASP.NET Under The Cover - Miguel A. Castro
Understanding ASP.NET Under The Cover - Miguel A. Castro
 
Asp.net
Asp.netAsp.net
Asp.net
 
15th june
15th june15th june
15th june
 
ASP.NET Request Processing Internals
ASP.NET Request Processing InternalsASP.NET Request Processing Internals
ASP.NET Request Processing Internals
 
ASP.NET Presentation
ASP.NET PresentationASP.NET Presentation
ASP.NET Presentation
 
Active Server Page - ( ASP )
Active Server Page - ( ASP )Active Server Page - ( ASP )
Active Server Page - ( ASP )
 
Web Server and how we can design app in C#
Web Server and how we can design app  in C#Web Server and how we can design app  in C#
Web Server and how we can design app in C#
 
Java servlet technology
Java servlet technologyJava servlet technology
Java servlet technology
 
Ch 04 asp.net application
Ch 04 asp.net application Ch 04 asp.net application
Ch 04 asp.net application
 
Skillwise - Advanced web application development
Skillwise - Advanced web application developmentSkillwise - Advanced web application development
Skillwise - Advanced web application development
 
Felix HTTP - Paving the road to the future
Felix HTTP - Paving the road to the futureFelix HTTP - Paving the road to the future
Felix HTTP - Paving the road to the future
 
Asp
AspAsp
Asp
 
Cognos Software Development Kit
Cognos Software Development KitCognos Software Development Kit
Cognos Software Development Kit
 

More from Julie Iskander

More from Julie Iskander (20)

HTML 5
HTML 5HTML 5
HTML 5
 
Data structures and algorithms
Data structures and algorithmsData structures and algorithms
Data structures and algorithms
 
C for Engineers
C for EngineersC for Engineers
C for Engineers
 
Design Pattern lecture 3
Design Pattern lecture 3Design Pattern lecture 3
Design Pattern lecture 3
 
Scriptaculous
ScriptaculousScriptaculous
Scriptaculous
 
Prototype Framework
Prototype FrameworkPrototype Framework
Prototype Framework
 
Design Pattern lecture 4
Design Pattern lecture 4Design Pattern lecture 4
Design Pattern lecture 4
 
Design Pattern lecture 2
Design Pattern lecture 2Design Pattern lecture 2
Design Pattern lecture 2
 
Design Pattern lecture 1
Design Pattern lecture 1Design Pattern lecture 1
Design Pattern lecture 1
 
Ajax and ASP.NET AJAX
Ajax and ASP.NET AJAXAjax and ASP.NET AJAX
Ajax and ASP.NET AJAX
 
jQuery
jQueryjQuery
jQuery
 
ASP.NET Lecture 5
ASP.NET Lecture 5ASP.NET Lecture 5
ASP.NET Lecture 5
 
ASP.NET Lecture 3
ASP.NET Lecture 3ASP.NET Lecture 3
ASP.NET Lecture 3
 
ASP.NET Lecture 1
ASP.NET Lecture 1ASP.NET Lecture 1
ASP.NET Lecture 1
 
AJAX and JSON
AJAX and JSONAJAX and JSON
AJAX and JSON
 
Object Oriented JavaScript
Object Oriented JavaScriptObject Oriented JavaScript
Object Oriented JavaScript
 
DOM and Events
DOM and EventsDOM and Events
DOM and Events
 
Introduction to Client-Side Javascript
Introduction to Client-Side JavascriptIntroduction to Client-Side Javascript
Introduction to Client-Side Javascript
 
HTML and CSS part 3
HTML and CSS part 3HTML and CSS part 3
HTML and CSS part 3
 
HTML and CSS part 2
HTML and CSS part 2HTML and CSS part 2
HTML and CSS part 2
 

Recently uploaded

Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersRaghuram Pandurangan
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxLoriGlavin3
 
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESmohitsingh558521
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxLoriGlavin3
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 

Recently uploaded (20)

Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information Developers
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
 
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 

ASP.NET lecture 8

  • 1. ASP.NET 4.0 Julie Iskander MSC. Communication and Electronics
  • 2. Lecture Outlines  Handlers and Modules  Deploying web application
  • 4.
  • 5.
  • 6. HttpModules  Simple classes that can plug themselves into the request- processing pipeline  Attaching to events thrown by the application.  Similar to Global.asax
  • 7. Global.asax HttpModules  Store global state  Store global state between requests between requests  Respond to application-  Respond to application- wide events wide events  A separate  Specific application assembly, that can be referenced by any application  Implements generic functionality that’s useful between different applications. Global.asax vs. HttpModules
  • 8. Creating an HTTPModule  Create a class implementing System.Web.IHttpModule interface  Requires to implement : Init and Dispose ◦ Init:  Input parameter: HttpApplication context  Access current application context  To implement HttpModule functionality  Used to wire-up different events that fire during request processing
  • 9. Creating an HTTPModule ◦ Dispose:  called once when the application terminates.  Application terminates and reinitializes when:  The application or IIS restarts,  The Web.config configuration file or a dependent assembly is modified.  Configure module in web.config
  • 10.
  • 11.
  • 12. Convert from an HTML to an aspx page
  • 13.
  • 14. ASP.NET features handled by modules:  Output Caching  Session State  Windows Authentication  Forms Authentication  Passport Authentication  Role manager  Anonymous Identification  Profile  ErrorHandlerModule
  • 15.
  • 16. HttpHandlers  The last stop for incoming HTTP Request  The point in the request processing pipeline that is responsible for serving up the requested content  Mapped to a specific file extension (.aspx, .html,.jpg…………)  Unlike modules, only one handler is used to process a request.
  • 17. Built-in HTTP Handlers Handler Description ASP.NET page handler (*.aspx) The default HTTP handler for all pages. Web service handler (*.asmx) The default HTTP handler for Web services Generic Web handler (*.ashx) The default HTTP handler for all Web handlers that do not have a UI and include @WebHandler directive
  • 18. Creating HttpHandlers  Using generic handler .ashx  Mapping the HttpHandler to a custom file extension.
  • 19. Generic HttpHandlers  Add new item Generic Handler (*.ashx)  Class implements IHttpHandler ◦ ProcessRequest:  Actually process incoming HTTP request.  Input argument:  HTTPContext object has access to all objects of the current HTTP context as response, request, user, profile, …….. ◦ IsReusable:  Property to let ASP.NET know whether incoming HTTP requests can reuse the same instance of the HttpHandler
  • 20.
  • 21. Convert from an HTML to an aspx page
  • 22. HttpHandlers to custom file extensions  Create a class that inherit from IHttpHandler, add it to App_code or in a separate library project to be added as an assembly  Implement the 2 methods same as previously  Add configuration to web.config
  • 23.
  • 24.
  • 25. Convert from an HTML to an aspx page
  • 27.
  • 28. Publish on Local IIS  Must run Visual Studio as Administration  Install all needed IIS components  Reinstall ASP.NET if needed  Make sure application pool is set to .NET Framework 4.0  Add user(with permissions to db and files) to application pool identity
  • 29. Publish on Local IIS  Use Copy Website  Use Publish Website
  • 30. Important Note  To avoid problems with configuration in machine root web.config ◦ Add <clear /> in all providers  To avoid problems with users and roles in multiple applications add applicationName attribute to all providers
  • 31. Reading Assignment #8  Chapter 26 – Professional ASP.NET 4 in CS and VB
  • 32. REFERENCES  [1] Beginning ASP.NET 4 In C# 2010, Matthew Macdonald, Apress  [2] Web Application Architecture Principles, Protocols And Practices, Leon Shklar And Richard Rosen, Wiley  [3] Professional AS P.NE T 4 In C# And VB, Bill Evjen, Scott Hanselman And Devin Rader, Wiley  [4] Pro ASP.NET In C# 2010, Fourth Edition,matthew Macdonald, Adam Freeman, And Mario Szpuszta, Apress

Editor's Notes

  1. Successor of ISAPI extensions and filters.Interact with the Web server itself.Interact with low level processes, as the processing of incoming and outgoing HTTP requests.
  2. Study ASP.NET request pipeline first
  3. AppendMessage.cs
  4. Difference between dynamic and static sites
  5. Try changing ContentType
  6. imageHandler.ashx
  7. Note to add it to IIS it must be an assembly
  8. Web.config: In all providers &lt;clear/&gt; first add applicationName