Presentation is loading. Please wait.

Presentation is loading. Please wait.

Christopher M. Pascucci Basic Structural Concepts of.NET Browser – Server Interaction.

Similar presentations

Presentation on theme: "Christopher M. Pascucci Basic Structural Concepts of.NET Browser – Server Interaction."— Presentation transcript:

1 Christopher M. Pascucci Basic Structural Concepts of.NET Browser – Server Interaction

2 Introduction  Web applications are a type of client/server application, which means that the functions of the applications are split between the client computer and server computer.  Client and servers are connected together via the Internet or other network and they communication using HTTP (Hypertext Transfer Protocol)  Web server stores the web applications that are accessed by the clients.  They can be configured to process ASPX, JSPX, PHP, etc…  Example web servers: Microsoft IIS & Apache  Most web applications use data stored in a database so it needs to implement a connection to a DBMS like SQLserver or Oracle.

3 Processing Static Web Pages  Static web pages are simple HTML pages that are stored on a web server. These pages don’t change in response to user input and the content is always the same.  A web browser requests a page from a web server by sending the server an HTTP request.  This request is initiated by typing in a URL, clicking a link, or begin redirected.  Includes the name of the HTML file being requested, the IP address of both the web browser and web server, etc…  A web server replies to a request with an HTTP response.  The response includes the HTML doc being requested.

4 Processing Dynamic Web Pages  Dynamic web pages are HTML pages that can change in some way each time the page is displayed. They are a web form with controls that allow the user to interact with the application.  Instead of being stored in the form of HTML, they are generated dynamically by the web application. 1.A web server receives a request for a dynamic page, it looks up the file extension of the requested file in a list to find out which application server should process this request.  If the extension is ASPX, the request is passed on to ASP.NET for processing.  If the extension is JSPX, the request is passed on to Tomcat for processing. 2.The application server receives the request and it runs the web form. The web form then generates an HTML document and returns it to the web server. 3.The web server then sends the HTML document back to the browser.

5 Dynamic Pages  After a dynamic page is displayed on the browser, the user can interact with it using its controls.  Some of the controls let the user start an HTTP request that post the page back to the server, which is called a postback.  The page is then processed over again using the data the user entered.  The entire process that starts with a browser requesting a page and ends with server returning the page is called a roundtrip.  There are two ways to a page can cause a postback to the server.  By using a submit button.  Through script. Sub checkForm() formName.submit() End Sub

6 ASPX Browser – Server Interaction

7 Christopher M. Pascucci Basic Structural Concepts of.NET Managing State & Scope

8 What is State  State refers to data maintained by an application for a single user.  An application must maintain a separate state for each user.  HTTP is a stateless protocol, which means it doesn’t maintain state between roundtrips.  Since HTTP is stateless the web applications must handle this.

9 How ASP.NET Maintains State  ViewState (Page)  Request  Application  Session  Cookies  Cache

10 How ASP.NET Maintains State  ViewState (Page)  Maintains the values of form control properties.  ViewState is implemented by default.  When a webform (aspx) is loaded, it can re-post to itself by means of a form submit.  A special state Boolean variable named IsPostBack is set to False when the page is initially loaded, and to True after its first postback.  Page state is maintained across postbacks to a single page by a single user.  Page state is sometimes called ViewState, because there is a ViewState object that contains property values for controls in the webform as well as the user created attribute/value collection; however, only simple data types and serializable objects can be stored in the ViewState object.  ViewState is maintained across postbacks. It stores the information (encrypted) in a hidden field in the form.

11 How ASP.NET Maintains State  Request  A Request object is created whenever a URL request is made from the browser to a web server.  Request state is maintained during the life of a single request object.  The program can access data from web form controls on the server-side by simply using Request(“FormControlName”) in the code.  Application  Application state is shared among all users (sessions) of an application.  It can be used to maintain values that apply to all users and you can add your own data/values to the application state object.  The Application is all pages contained in a given web site. The application starts when the first user sends a URL to the web server on which the web is located. It ends when the last client (user) of the web ends its session or when the application is stopped/restarted.

12 How ASP.NET Maintains State  Session  Session state is unique to each user of an application but maintained throughout their use of the application.  A Session is started when a user sends a URL to activate a given web site or Application.  The session can end in one of 3 ways: 1.If there is no request sent for a time called the Session Inactive Time. There is a default value set within the web server for this time, but it can be overridden by the session.Timeout property for a particular session object.session.Timeout 2.By the program using the session.Abandon methodsession.Abandon 3.If the client is terminated by closing the browser window, but Session Inactive Time will still have to elapse.

13 How ASP.NET Maintains State  Cookies  Cookie state is maintained in the client browser and can persist across page, session and application state.  It can even persist after the application terminates, for any predetermined time period. Its lifetime can be programmatically controlled.  Cache  Cache state has application scope but variable lifetime determined by the following events: Specific files or database tables being updated Another Cache attribute changes value Time expiration

Download ppt "Christopher M. Pascucci Basic Structural Concepts of.NET Browser – Server Interaction."

Similar presentations

Ads by Google