CS 3870/CS 5870 AJAX Prog8.

Slides:



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

Module 1: Creating Responsive Pages with Ajax Creating Partial-Page Updates by Using AJAX Scripting Actions on the Web Client.
ASP.NET Ajax Supplementary Tutorial. Why Use ASP.NET AJAX? - I ASP.NET AJAX enables you to build rich Web applications that have many advantages over.
Slickr : A Capstone Web Development Project Using Databases, ASP.NET, Web Services, and AJAX Mark Frydenberg Computer Information Systems Dept. Bentley.
AJAX Development Mike Ormond Developer & Platform Group Microsoft Ltd
ASP.Net AJAX. AJAX Asynchronous JavaScript and XML: – JavaScript, Document Object Model, Cascade Style Sheet, XML, server-side script such as.Net, etc.
Introduction to ASP.Net ISYS 350. ASP.NET ASP.NET is a server-side technology for creating dynamic web pages. ASP.NET allows you to use a selection of.
Christopher M. Pascucci Basic Structural Concepts of.NET Browser – Server Interaction.
ASP.NET AJAX. Content ASP.NET AJAX Ajax Control Toolkit Muzaffer DOĞAN - Anadolu University2.
Ryan Putz. Outline  What is Ajax?  Member Technologies  Methodology  When and When Not To Use  Who’s Using Ajax?  Code Examples.
1 CS 3870/CS 5870 Static and Dynamic Web Pages ASP.NET and IIS.
JavaScript & jQuery the missing manual Chapter 11
1 CS 3870/CS 5870 Static and Dynamic Web Pages ASP.NET and IIS.
Dr. Azeddine Chikh IS444: Modern tools for applications development.
CSCI 6962: Server-side Design and Programming Introduction to AJAX.
ASP.NET + Ajax Jesper Tørresø ITNET2 F08. Ajax Ajax (Asynchronous JavaScript and XML) A group of interrelated web development techniques used for creating.
.Net is a collection of libraries, templates and services designed to make programming applications of all kinds, easier, more flexible (multi platform),
ASP.NET AJAX 1. Ordinary web applications vs. AJAX Ordinary web application The full page is updated at each request The page is not available while being.
Overview of Previous Lesson(s) Over View  ASP.NET Pages  Modular in nature and divided into the core sections  Page directives  Code Section  Page.
Chapter 10 – AJAX Dr. Stephanos Mavromoustakos. Chapter Overview AJAX (Asynchronous JavaScript And XML) Ajax allows your client-side web pages to exchange.
CSCI 6962: Server-side Design and Programming AJAX Tools in JSF and ASP.
1 CS 3870/CS 5870 Note04 Session Variables and Post Back.
Joe Hummel, PhD Dept of Mathematics and Computer Science Lake Forest College
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.
© FPT SOFTWARE – TRAINING MATERIAL – Internal use 04e-BM/NS/HDCV/FSOFT v2/3 Unit 2 : Creating a Microsoft ASP.NET Web Form.
Ventsislav Popov Crossroad Ltd.. 1. What is AJAX?  AJAX Concept  ASP.NET AJAX Framework 2. ASP.NET AJAX Server Controls  ScriptManager, UpdatePanel.
Telerik Software Academy ASP.NET Web Forms Telerik Software Academy ASP.NET Web Forms.
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.
T U T O R I A L  2009 Pearson Education, Inc. All rights reserved Bookstore Application: Middle Tier Introducing Code-Behind Files, Session State.
1 CS 3870/CS 5870: Note 19 SiteMap and AJAX Lab 8.
The Module Road Map Assignment 1 Road Map We will look at… Internet / World Wide Web Aspects of their operation The role of clients and servers ASPX.
Ajax for Dynamic Web Development Gregory McChesney.
1 CS 3870/CS 5870: Note 18 SiteMap Prog8. Test 2 50 Points Thursday, Nov 12 2:00 PM – 4:00 PM Lab
Mr. Justin “JET” Turner CSCI 3000 – Fall 2015 CRN Section A – TR 9:30-10:45 CRN – Section B – TR 5:30-6:45.
IT533 Lectures ASP.NET AJAX.
1 CS 3870/CS 5870: Note 14. Prog5 Due 10 PM Wednesday, Oct 21 Authentication and Authorization 2.
1111 Creating ASPX Controls Programatically Objectives You will be able to Dynamically add controls to a page. Dynamically alter properties of controls.
 ASP.NET provides an event based programming model that simplifies web programming  All GUI applications are incomplete without enabling actions  These.
1 CS 3870/CS 5870: Note 19 AJAX Prog8. Test 2 50 Points Thursday, Nov 12 2:00 PM – 4:00 PM Lab
Name Title Microsoft Corporation
Sergey Sidorov PhD student, computer software chair Computer Science department.
The Microsoft Technical Roadshow 2007 AJAX Development Mike Ormond Developer & Platform Group Microsoft Ltd
ASP.NET AJAX Fedorov Sergey, student of Computing Mathematic and Cybernetics faculty, software department, NNGU
Chapter 1 Getting Started with ASP.NET Objectives Why ASP? To get familiar with our IDE (Integrated Development Environment ), Visual Studio. Understand.
Computing with C# and the .NET Framework
 2009 Pearson Education, Inc. All rights reserved.
ASP.NET AJAX.
ASP.NET Forms.
CS 3870/CS 5870 Web Service.
Working with ASP.NET Server Controls
ASP.NET AJAX – Basics Svetlin Nakov Telerik Corporation
CS 3870/CS 5870 Web User Controls.
Session Variables and Post Back
Working with Client-Side Scripting
Introduction to Client-Server Programming
Haritha Dasari Josue Balandrano Coronel -
How to Create a Simple Web Service and Use it in ASP.Net
AJAX.
Ajax 4.0.
Jim Fawcett CSE686 – Internet Programming Summer 2008
© 2016, Mike Murach & Associates, Inc.
MIS Professor Sandvig MIS 424 Professor Sandvig
Introducing ASP.net with Visual Studio Environment
Static and Dynamic Web Pages
ASP.NET.
DR. JOHN ABRAHAM PROFESSOR UTPA
AJAX Calendar Control Rehab AlFallaj.
Introduction to JavaScript
Presentation transcript:

CS 3870/CS 5870 AJAX Prog8

ASP.NET and AJAX Processing of dynamic pages Generate entire page on each request Extra processing Extra network load AJAX: to make dynamic pages the same as Windows forms Update only the controls that changed

ASP.NET AJAX Asynchronous JavaScript And XML Partial Page Updates with ASP.NET AJAX A JavaScript library sent to client Calls made by the library sent back to the server The page is updated partially by the library The browser does not know it at all! The browser does not know it at all!

AJAX Extensions VS.NET ToolBox ScriptManager UpdatePanel ScriptManagerProxy Timer UpdateProgress

ScriptManager One on each page the master page the content pages

UpdatePanel One or more UpdatePanels on each page Properties ContentTemplate Containing all the controls to be updated partially Triggers Containing all controls with the events that will trigger partial update UpdateMode Always (default) Conditional

Example Create a folder Prog8 Add a page Default.aspx Add two textboxes and one button txtInput txtSqrt Button1 No AJAX controls yet

Computing Square Root Protected Sub Button1_Click(…) Handles . . . txtSqrt.Text = FormatNumber(Math.Sqrt(txtInput.Text), 2) End Sub

Full Page Update Go to other page and back Compute three times with input 5 50 500 Click Back and Forward on the browser Each computation re-displayed Full page update

Adding AJAX Controls <asp:ScriptManager ID="ScriptManager1" runat="server"> </asp:ScriptManager> <asp:UpdatePanel ID="UpdatePanel1" runat="server"> <ContentTemplate> <asp:TextBox ID="txtSqrt" runat="server"></asp:TextBox> <asp:Button ID="Button1" runat="server" Text="Button" /> <asp:TextBox ID="txtInput" runat="server"></asp:TextBox> </ContentTemplate> </asp:UpdatePanel>

Partial Page Update Go to other page and back Compute three times with input 5 50 500 Click Back and Forward on the browser Go back to the other page Partial page update

Button1 is Outside of UpdatePanel <asp:ScriptManager ID="ScriptManager1" runat="server"> </asp:ScriptManager> <asp:UpdatePanel ID="UpdatePanel1" runat="server"> <ContentTemplate> <asp:TextBox ID="txtSqrt" runat="server"></asp:TextBox> <asp:TextBox ID="txtInput" runat="server"></asp:TextBox> </ContentTemplate> </asp:UpdatePanel> <asp:Button ID="Button1" runat="server" Text="Button" />

Button1 is Out Side of UpdatePanel Go to other page and back Compute three times with input 5 50 500 Click Back and Forward on the browser Full page update

Adding Trigger <asp:ScriptManager ID="ScriptManager1" runat="server"> </asp:ScriptManager> <asp:UpdatePanel ID="UpdatePanel1" runat="server"> <ContentTemplate> <asp:TextBox ID="txtSqrt" runat="server"></asp:TextBox> <asp:TextBox ID="txtInput" runat="server"></asp:TextBox> </ContentTemplate> <Triggers> <asp:AsyncPostBackTrigger ControlID="Button1" EventName="Click" /> </Triggers> </asp:UpdatePanel> <asp:Button ID="Button1" runat="server" Text="Button" />

Button1 is Out Side of UpdatePanel wit Trigger Go to other page and back Compute three times with input 5 50 500 Click Back and Forward on the browser Partial page update

txtInput is Outside of UpdatePanel <asp:ScriptManager ID="ScriptManager1" runat="server"> </asp:ScriptManager> <asp:UpdatePanel ID="UpdatePanel1" runat="server"> <ContentTemplate> <asp:TextBox ID="txtSqrt" runat="server"></asp:TextBox> </ContentTemplate> <Triggers> <asp:AsyncPostBackTrigger ControlID="Button1" EventName="Click" /> </Triggers> </asp:UpdatePanel> <asp:TextBox ID="txtInput" runat="server"></asp:TextBox> <asp:Button ID="Button1" runat="server" Text="Button" />

Textbox txtInput is out side of UpdatePanel Partial page update User input is always passed back to server

Clear the Input Not cleared Protected Sub Button1_Click(…) Handles . . . txtSqrt.Text = FormatNumber(Math.Sqrt(txtInput.Text), 2) txtInpt.Text = “” End Sub Not cleared Partial page update and txtInput is excluded

More Controls Add textbox txtDouble Add Button2 Add UpdatePanel2

Button Click Events Protected Sub Button1_Click(…) Handles . . . txtSqrt.Text = FormatNumber(Math.Sqrt(txtInput.Text), 2) txtDouble.Text = “” End Sub Protected Sub Button2_Click(…) Handles . . . txtDouble.Text = 2 * txtInput.Text txtSqrt.Text = “”

Multiple UpdatePanels txtSqrt Trigger: Button1 UpdatePanel2 txtDouble Trigger: Button2

Add Triggers Select UpdatePanel2 Properties Windows Triggers (Collection) Add ControlID: Button1 EventName: click

UpdateMode Always (Default) Conditional Apply Conditional to both UpdatePanels

Control Position <asp:UpdatePanel ID="UpdatePanel1" runat="server"> <ContentTemplate> <asp:TextBox ID="txtSqrt" runat="server"></asp:TextBox> <asp:TextBox ID="txtInput" runat="server“ style="position: relative; top: 120px ></asp:TextBox> </ContentTemplate> </asp:UpdatePanel> <asp:Button ID="Button1" runat="server" Text="Button" style="position: relative; top: -60px />

Test 3 Thursday, Dec 8 Web application using AJAX Membership No Roles Create users Allow and deny users access No Roles