introduction to asp.net1. 2 web applications in general web applications are divided into two parts...
TRANSCRIPT
![Page 1: Introduction to ASP.NET1. 2 Web applications in general Web applications are divided into two parts –The server part –The client part The server part](https://reader036.vdocuments.site/reader036/viewer/2022083008/56649ef35503460f94c05e09/html5/thumbnails/1.jpg)
Introduction to ASP.NET 1
Introduction to ASP.NET
![Page 2: Introduction to ASP.NET1. 2 Web applications in general Web applications are divided into two parts –The server part –The client part The server part](https://reader036.vdocuments.site/reader036/viewer/2022083008/56649ef35503460f94c05e09/html5/thumbnails/2.jpg)
Introduction to ASP.NET 2
Web applications in general
• Web applications are divided into two parts– The server part– The client part
• The server part is usually programmed as “extensions” to an HTTP server (aka web server)
• The client part is usually executed by a web browser
• The HTTP protocol is used for communication between the client and the server
![Page 3: Introduction to ASP.NET1. 2 Web applications in general Web applications are divided into two parts –The server part –The client part The server part](https://reader036.vdocuments.site/reader036/viewer/2022083008/56649ef35503460f94c05e09/html5/thumbnails/3.jpg)
Introduction to ASP.NET 3
Some web application frameworks
• Sun/Oracle Java Servlets + JSP
• PHP
• CGI (Common Gateway Interface)– Very old
• Ruby on Rails
• Microsoft ASP.NET
• Microsoft ASP– From before ASP.NET
![Page 4: Introduction to ASP.NET1. 2 Web applications in general Web applications are divided into two parts –The server part –The client part The server part](https://reader036.vdocuments.site/reader036/viewer/2022083008/56649ef35503460f94c05e09/html5/thumbnails/4.jpg)
Introduction to ASP.NET 4
ASP.NET web applications
• ASP.NET is Microsoft’s way of making web application
• ASP.NET is programmed using a programming language– Usually VB.Net or C#
• The web server is usually Microsoft IIS– Internet Information Service
![Page 5: Introduction to ASP.NET1. 2 Web applications in general Web applications are divided into two parts –The server part –The client part The server part](https://reader036.vdocuments.site/reader036/viewer/2022083008/56649ef35503460f94c05e09/html5/thumbnails/5.jpg)
Introduction to ASP.NET 5
ASP.NET
• ASP.NET is executed on the server side
• ASP.NET produces HTML, JavaScript,etc. to be shown / executed on the client side– By the browser
![Page 6: Introduction to ASP.NET1. 2 Web applications in general Web applications are divided into two parts –The server part –The client part The server part](https://reader036.vdocuments.site/reader036/viewer/2022083008/56649ef35503460f94c05e09/html5/thumbnails/6.jpg)
Introduction to ASP.NET 6
Controls
• ASP.NET pages consists of– Pure HTML– Forms
• To accept user input
– Code• Usually written in VB.NET or C#
– Controls
• Code + controls are executed on the server producing HTML, JavaScript, etc.
![Page 7: Introduction to ASP.NET1. 2 Web applications in general Web applications are divided into two parts –The server part –The client part The server part](https://reader036.vdocuments.site/reader036/viewer/2022083008/56649ef35503460f94c05e09/html5/thumbnails/7.jpg)
Introduction to ASP.NET 7
Postback
• Forms– Accept user input– Data is sent back to the same ASP.NET page
• Using HTTP POST request• Called postback
• Sometimes the ASP.NET pages wants to know if it’s executing a first request or postback
![Page 8: Introduction to ASP.NET1. 2 Web applications in general Web applications are divided into two parts –The server part –The client part The server part](https://reader036.vdocuments.site/reader036/viewer/2022083008/56649ef35503460f94c05e09/html5/thumbnails/8.jpg)
Introduction to ASP.NET 8
Events
• Many ASP.NET controls sends events– Button has a ”button_click” event, etc.– Page has ”page_load” event, etc.– TextBox has ”textChanged” event
• Event handlers (methods) are usually placed in the codebehind file
• Event code are executed at the server– Events generate a HTTP request/response
![Page 9: Introduction to ASP.NET1. 2 Web applications in general Web applications are divided into two parts –The server part –The client part The server part](https://reader036.vdocuments.site/reader036/viewer/2022083008/56649ef35503460f94c05e09/html5/thumbnails/9.jpg)
Introduction to ASP.NET 9
viewState
• HTTP is stateless
• ASP.NET keeps track of the state between postbacks– Hidden FORM field where the state of other
FORM fields is kept– Encoded, but not encrypted– Decoded at the server side
![Page 10: Introduction to ASP.NET1. 2 Web applications in general Web applications are divided into two parts –The server part –The client part The server part](https://reader036.vdocuments.site/reader036/viewer/2022083008/56649ef35503460f94c05e09/html5/thumbnails/10.jpg)
Introduction to ASP.NET 10
Code behind / beside
• ASP.NET pages are generally split into two parts– View
• HTML + controls
– Code• Often called “code behind” or “code beside”• Event handlers
• Separation of concerns
• C# syntax: Partial class