3. KELEBIHAN Mudah digunakan Lebih cepat dari PHP Language support (VB.NET, C#, etc) User friendly Murah (free installation package)
4. How Active Server Pages Work Client sends request Server receives request and directs it to ASP ASP processes, then returns result to client HTTP request types Request methods GET Gets (retrieves) information from server Retrieve HTML document or image POST Posts (sends) data to server Send info from HTML form Client-entered data Info to search Internet Query for a database Authentication info
5. How Active Server Pages Work Browsers often cache Web pages Cache: save on disk Typically do not cache POST response Next POST request may not return same result Client requests ASP file Parsed (top to bottom) by ActiveX component asp.dll ActiveX component: server-side ActiveX control that usually does not have GUI Code executed as encountered @LANGUAGE statement Specifies scripting language If not used, VBScript assumed As interpreted, HTML (plus client-side scripts) sent to client Parsed each time requested Web server must support ASP by providing component such as asp.dll
6. ASP .NET 2.0 & AJAX Server-side ActiveX Components Web controls Session tracking Case study AJAX
7. Server-side ActiveX Components Server-side ActiveX components Typically do not have GUI If scripting language for ASP not support certain feature, create ActiveX Server component Visual C++, Visual Basic, Delphi, etc. Usually execute faster than scripting language equivalents Executed on server Client does not need to support ActiveX technologies
12. Text Controls (2) <script runat="server">Sub submit(sender As Object, e As EventArgs) lbl1.Text="Your name is " & txt1.TextEnd Sub</script><html><body><form runat="server">Enter your name:<asp:TextBox id="txt1" runat="server" /><asp:Button OnClick="submit" Text="Submit" runat="server" /><p><asp:Label id="lbl1" runat="server" /></p></form></body></html>
19. What is a Cookie? A cookie is often used to identify a user. A cookie is a small file that the server embeds on the user's computer. Each time the same computer requests a page with a browser, it will send the cookie too. With ASP, you can both create and retrieve cookie values.
20. Accessing a Database from an Active Server Page ASP can communicate with databases Via ADO (ActiveX Data Objects) Three-tier distributed applications User interface Often created using HTML, Dynamic HTML or XML Business logic Use Web servers Database access All three tiers may reside on separate computers connected to a network
27. AJAX AJAX = Asynchronous JavaScript and XML. AJAX is based on JavaScript and HTTP requests. AJAX is not a new programming language, but a new way to use existing standards. AJAX is the art of trading data with a web server, and changing parts of a web page, without reloading the whole page.
28. Sejarah AJAX Padaawalnya ASP.NET AJAX diberinama Atlas. Dirilispadatahun 2005 dalambentuk CTPs (Community Tkenis Previews) ASP.NET AJAX 1.0 RTM dirilis 23 januari 2007 sebagaitembahan ASP.NET 2.0
29. Browser support IE (>= 6.0) Mozilla Firefox (>= 1.5) Opera (>= 9.0) Apple Safari (>= 2.0) Google Chrome
30. Arsitektur ASP.NET AJAX ASP.NET AJAX merupakan framework ygterdiridaripusaka script client dankomponen server ygterintegrasi. Komponen server ASP.NET AJAX terdiridarikontrol – kontrol web server ASP.NET dan komponen2 untungmengatur UI danaluraplikasi, validasi, control server, dansebagainya.
31. Control server Contoh control server ASP.NET AJAX ygseringdigunakan : - ScriptManager - UpdatePanel - UpdateProgress - Timer
ASP.NET is a web application framework developed and marketed by Microsoft to allow programmers to build dynamic web sites, web applications and web services. It was first released in January 2002 with version 1.0 of the .NET Framework, and is the successor to Microsoft's Active Server Pages (ASP) technology. ASP.NET is built on the Common Language Runtime (CLR), allowing programmers to write ASP.NET code using any supported .NET language. The ASP.NET SOAP extension framework allows ASP.NET components to process SOAP messages.
ActiveX is a framework for defining reusable software components that perform a particular function or a set of functions in Microsoft Windows in a way that is independent of the programming language used to implement them. A software application can then be composed from one or more of these components in order to provide its functionality
<script runat="server">Sub submit(sender As Object, e As EventArgs) lbl1.Text="Your name is " & txt1.TextEnd Sub</script><html><body><form runat="server">Enter your name:<asp:TextBox id="txt1" runat="server" /><asp:Button OnClick="submit" Text="Submit" runat="server" /><p><asp:Label id="lbl1" runat="server" /></p></form></body></html>
<script runat="server"> Sub change_url(sender As Object, e As AdCreatedEventArgs) e.NavigateUrl="http://www.w3schools.com" End Sub </script><html><body><form runat="server"><asp:AdRotator AdvertisementFile="Ad1.xml"runat="server" OnAdCreated="change_url"target="_blank" /></form><p><a href="ad1.xml" target="_blank">View XML file</a></p></body></html>
ScriptManagerMengatursumberdaya script komponen-komponen client, merenderbagiandarihalaman, localization, globalization, dan custom user script. Script manager dibutuhkanolehUpdatePanel, UpdateProgressdankontrol Timer.UpdatePanelDigunakanuntukmembuat rendering sebagianhalaman (partial rendering), bukankeseluruhanhalaman.UpdateProgressMemberikaninformasimengenai status bagianhalaman yang ter-update dalamkontrolUpdatePanel.TimerMelakukanpostbackke server berdasarkan interval waktu yang telahditentukan. Kontrol Timer dapatdigunakanuntukmelakukanpostbackkeseluruhanhalamanatausebagaianhalaman yang adadalamUpdatePanel.
<html><head><script type="text/javascript">function loadXMLDoc(url){if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari xmlhttp=new XMLHttpRequest(); }else {// code for IE6, IE5 xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); }xmlhttp.open("GET",url,false);xmlhttp.send(null);document.getElementById('test').innerHTML=xmlhttp.responseText;}</script></head><body><div id="test"><h2>Click to let AJAX change this text</h2></div><button type="button" onclick="loadXMLDoc('test1.txt')">Click Me</button><button type="button" onclick="loadXMLDoc('test2.txt')">Click Me</button></body></html>