Introduction to Client-Server Programming

Slides:



Advertisements
Similar presentations
Unit 02. ASP.NET Introduction HTML & Server controls Postbacks Page Lifecycle.
Advertisements

 2004 Prentice Hall, Inc. All rights reserved. Chapter 23 – ASP.NET Outline 23.1 Introduction 23.2.NET Overview NET Framework ASP (Active.
Session 13 Active Server Pages (ASP) Matakuliah: M0114/Web Based Programming Tahun: 2005 Versi: 5.
11 ASP.NET Slides based off:. 22 B ACKGROUND - W EB A RCHITECTURE Web Server PC/Mac/Unix/... + Browser Client Server Request:
ASP.NET (Active Server Page) SNU OOPSLA Lab. October 2005.
DT211/3 Internet Application Development Active Server Pages & IIS Web server.
Building Applications using ASP.NET and C# / Session 1 / 1 of 21 Session 1.
Session 6 Server-side programming - ASP. An ASP page is an HTML page interspersed with server-side code. The.ASP extension instead of.HTM denotes server-side.
Web Development Using ASP.NET CA – 240 Kashif Jalal Welcome to week – 1.1 of…
Kashif Jalal CA-240 (072) Web Development Using ASP.NET CA – 240 Kashif Jalal Welcome to week – 2 of…
Chapter 11 ASP.NET JavaScript, Third Edition. 2 Objectives Learn about client/server architecture Study server-side scripting Create ASP.NET applications.
Christopher M. Pascucci Basic Structural Concepts of.NET Browser – Server Interaction.
Joe Hummel, PhD Dept of Mathematics and Computer Science Lake Forest College Lecture 8: WebForms — Web-based.
Tutorial: Introduction to ASP.NET Internet Technologies and Web Application 4 th February 2010.
8 Chapter Eight Server-side Scripts. 8 Chapter Objectives Create dynamic Web pages that retrieve and display database data using Active Server Pages Process.
1 CS 3870/CS 5870 Static and Dynamic Web Pages ASP.NET and IIS.
Architecture Of ASP.NET. What is ASP?  Server-side scripting technology.  Files containing HTML and scripting code.  Access via HTTP requests.  Scripting.
Introduction to ASP.NET. Prehistory of ASP.NET Original Internet – text based WWW – static graphical content  HTML (client-side) Need for interactive.
Object-Oriented Application Development Using VB.NET 1 Chapter 12 Web Forms, HTML, and ASP.NET.
ASP.NET INTRODUCTION INTO وزارة التربية و التعليم العالي كلية العلوم و التكنولوجيا قسم علوم الحاسوب و تكنولوجيا المعلومات اعداد الاستاذ: عبد الله محمد.
Joe Hummel, PhD Dept of Mathematics and Computer Science Lake Forest College
An Introduction to ASP.NET Ed Dunhill blogs.msdn.com/edunhill SLIDE7.
Overview of Previous Lesson(s) Over View  ASP.NET Pages  Modular in nature and divided into the core sections  Page directives  Code Section  Page.
© 2008 Dr. Paul Walcott – The University of the West Indies: Cave Hill CampusDr. Paul Walcott COMP6325 Advanced Web Technologies Dr. Paul Walcott The University.
Beginning Web Site Development Module 1 – Dynamic Web Site Development Fundamentals of building dynamic Web sites with ASP.NET 2.0 and C# Version.
ASP.Net Web Applications. Characteristics of a typical data driven web application Web Server HTML Graphics Active-X Java Applets HTTP Request ADO / JDBC.
5 Chapter Five Web Servers. 5 Chapter Objectives Learn about the Microsoft Personal Web Server Software Learn how to improve Web site performance Learn.
© Minder Chen, ASP.NET 2.0: Introduction - 1 ASP.NET 2.0 Minder Chen, Ph.D. Framework Base Class Library ADO.NET: Data & XML.
Elements of ASP Documents Adapted from MCDN Web Workshop ( and Webmonkey’s Introduction to Active.
ASP.NET.. ASP.NET Environment ASP.NET is Microsoft's programming framework that enables the development of Web applications and services. It is an easy.
ASP Introduction Y.-H. Chen International College Ming-Chuan University Fall, 2004.
Murach’s ASP.NET 4.0/VB, C1© 2006, Mike Murach & Associates, Inc.Slide 1.
Active Server Pages  In this chapter, you will learn:  How browsers and servers interacted on the Internet when the Internet first became popular 
COMP3241 E-Business Technologies Richard Henson University of Worcester October 2012.
Introducing ASP.NET 2.0. Internet Technologies WWW Architecture Web Server Client Server Request Response Network HTTP TCP/IP PC/Mac/Unix + Browser (IE,
Module 4: Creating a Microsoft ASP.NET Web Form. Overview Creating Web Forms Using Server Controls.
Session 4: HTML and Web Server Controls. Outline Creating Web Forms Using Server Controls HTML Server Controls Web Server Controls Writing ASP Code Inline.
Module 1: Working with ASP.NET. Overview Introducing ASP.NET Creating Web Forms Adding ASP.NET Code to a Page Handling Page Events Discussion: ASP vs.
ASP (Active Server Pages) by Bülent & Resul. Presentation Outline Introduction What is an ASP file? How does ASP work? What can ASP do? Differences Between.
ASP.NET in Definition: 1.ASP.NET is a web application framework developed and marketed by Microsoft to allow programmers to build dynamic web sites,
Client-side & Server-side Scripting ©Richard L. Goldman August 5, 2003 Requires PowerPoint 2002 or later for full functionality.
ASP.NET (Active Server Page) SNU OOPSLA Lab. October 2005.
8 Chapter Eight Server-side Scripts. 8 Chapter Objectives Create dynamic Web pages that retrieve and display database data using Active Server Pages Process.
ASP. ASP is a powerful tool for making dynamic and interactive Web pages An ASP file can contain text, HTML tags and scripts. Scripts in an ASP file are.
ASP-2-1 SERVER AND CLIENT SIDE SCRITPING Colorado Technical University IT420 Tim Peterson.
Svetlin Nakov Telerik Corporation
Introduction to ASP.NET development. Background ASP released in 1996 ASP supported for a minimum 10 years from Windows 8 release ASP.Net 1.0 released.
Chapter 1 Getting Started with ASP.NET Objectives Why ASP? To get familiar with our IDE (Integrated Development Environment ), Visual Studio. Understand.
1 Chapter 1 INTRODUCTION TO WEB. 2 Objectives In this chapter, you will: Become familiar with the architecture of the World Wide Web Learn about communication.
Tonga Institute of Higher Education IT 141: Information Systems
Computing with C# and the .NET Framework
ASP.NET Forms.
Working with ASP.NET Server Controls
Section 6.3 Server-side Scripting
Web Forms, HTML, and ASP.NET
Florida Gulf Coast University
ASP.NET Web Forms and Web Services
Haritha Dasari Josue Balandrano Coronel -
PHP / MySQL Introduction
Chapter 23 – ASP.NET Outline 23.1 Introduction NET Overview
מבוא ל ASP.NET שיעור 1 : מבוא ל ASP.NET מצגת מס' 1
Client side & Server side scripting
Moving from ASP to ASP.NET
Web Development Using ASP .NET
Tonga Institute of Higher Education IT 141: Information Systems
Static and Dynamic Web Pages
Tonga Institute of Higher Education IT 141: Information Systems
ASP.NET.
ASP.NET Imran Rashid CTO at ManiWeber Technologies.
5/6/2019 Session 8.2 Postback, ViewState
Presentation transcript:

Introduction to Client-Server Programming ASP.NET

Client-Server Cycle Client requests page Client formats an HTTP request HTTP Example: Server Side Server responds… Finds requested file Formulates response and sends to client Header Fields (informs client) Body (content) Client Server TCP/IP

ASP Implemented via asp.dll (ISAPI) Process ASP files before sending to client Uses VBScript or JavaScript Embed code & data (BAD!) Mixes content with code Optionally #include

ASP (cont) Limits access to controls Ad Rotator FileSystemObject ADO (ActiveX Data Object) – DB Connections Can purchase 3rd party components or develop COM wrappers to access Win32 API

ASP.NET Implemented via ISAPI – aspnet_isapi.dll Processes ASPX files before sending to client Uses the CLR (common language runtime) Can program ASP.NET in ANY CLR language (C# & VB.NET most popular)

ASP.NET Full access to the .NET Class Library (immense!) Session information shared across multiple servers (server farm – scalability) Configuration easy via .config files

ASP.NET in C# Two sides: A simple “calculator” example… Code definition HTML asp:SOMETHING object A simple “calculator” example…

The Form <HTML> <BODY> <form RunAt="server"> Absolutely, positively NEVER forget the RunAt attribute! <HTML> <BODY> <form RunAt="server"> <asp:Textbox id="op1" RunAt="server"/> <asp:TextBox id="op2" RunAt="server"/> <asp:Button id="Sum" text="=" OnClick="DoAdd" RunAt="server"/> <asp:Label id="Result" RunAt="server"/> </form> </BODY> </HTML>

The Code <SCRIPT Language="C#" RunAt="server"> void DoAdd (Object sender, EventArgs e) { int i = Convert.ToInt32(op1.Text); int j = Convert.ToInt32(op2.Text); int r = i + j; Result.Text = r.ToString(); } </SCRIPT>

Two Options Place the HTML and SCRIPT in one file with an ASPX extension Place the HTML in a file with an ASPX extension Place the code in a file with a “.cs” extension Add a reference to the code file in the ASPX file <%@ Page language="c#" src="SOURCE.cs" %>

When an ASPX File is Requested Client sends a request to server for add.aspx Server locates file & realizes its extension Sends it to the appropriate ISAPI processor Processes file, replacing references to asp object controls with HTML 4.01 Only compiles file if it has changed since last referenced (JIT) Uses cache copy of file if possible (improves performance) Executes Load and Init functions (if any) Adds hidden “state” information Client only sees HTML, no source code at all Serves the result to client Client receives HTML and renders it in browser

Client-Server Request/Response Process

When an Event is Generated Callback to server Function is executed Possible changes to HTML Server responds with HTML 4.01 results Does require round-trip Usually efficient b/c of small data in transit

Putting it Together (calc.aspx) <HTML> <BODY> <form RunAt="server"> <asp:Textbox id="op1" RunAt="server"/> <asp:TextBox id="op2" RunAt="server"/> <asp:Button id="Sum" text="=" OnClick="DoAdd" RunAt="server"/> <asp:Label id="Result" RunAt="server"/> </form> </BODY> <SCRIPT Language="C#" RunAt="server"> void DoAdd (Object sender, EventArgs e) { int i = Convert.ToInt32(op1.Text); int j = Convert.ToInt32(op2.Text); int r = i + j; Result.Text = r.ToString(); } </SCRIPT> </HTML>

Two More Tasks Create a virtual directory in IIS pointing to the directory that contains calc.aspx Remember – all dynamic pages MUST be viewed in a browser (you can’t just double-click them in explorer) Allows you to view the page in your browser Run the “permissions wizard” on this new virtual directory Allows the ASP.NET page to be processed Get an error (“cannot display page”) if you forget this step

Resultant Page (FINALLY)

The HTML Source Auto-generated material is highlighted <HTML> <BODY> <form name="_ctl0" method="post" action="calc.aspx" id="_ctl0"> <input type="hidden" name="__VIEWSTATE"value="dDwtMTM3MDk5MDcwNDs7PvmsttsAS+T3BC5jicR6A+ndD0Ow" /> <input name="op1" type="text" id="op1" /> <input name="op2" type="text" id="op2" /> <input type="submit" name="Sum" value="=" id="Sum" /> <span id="Result"></span> </form> </BODY> </HTML> Auto-generated material is highlighted

Resultant Page (after submit)

The HTML Source (after submit) <BODY> <form name="_ctl0" method="post" action="calc.aspx" id="_ctl0"> <input type="hidden" name="__VIEWSTATE" value="dDwtMTM3MDk5MDcwNDt0PDtsPGk8MT47PjtsPHQ8O2w8aTw3Pjs+O2w8dDxwPHA8bDxUZXh0Oz47bDwxMjs+Pjs+Ozs+Oz4+Oz4+Oz6pyFGIUcsfx+JmwPKg9fE2//Jx4Q==" /> <input name="op1" type="text" value="5" id="op1" /> <input name="op2" type="text" value="7" id="op2" /> <input type="submit" name="Sum" value="=" id="Sum" /> <span id="Result">12</span> </form> </BODY> </HTML> Modified material is highlighted