Presentasi Kelompok 25 PW A+B

1,300 views

Published on

presentasi kelompok 25 PW A+B 2010
Teknik Informatika ITS

Published in: Technology
1 Comment
0 Likes
Statistics
Notes
  • Be the first to like this

No Downloads
Views
Total views
1,300
On SlideShare
0
From Embeds
0
Number of Embeds
99
Actions
Shares
0
Downloads
0
Comments
1
Likes
0
Embeds 0
No embeds

No notes for slide
  • 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
  • <html><body><form runat="server">A basic TextBox:<asp:TextBox id="tb1" runat="server" /><br /><br />A password TextBox:<asp:TextBox id="tb2" TextMode="password" runat="server" /><br /><br />A TextBox with text:<asp:TextBox id="tb4" Text="Hello World!" runat="server" /><br /><br />A multiline TextBox:<asp:TextBox id="tb3" TextMode="multiline" runat="server" /><br /><br />A TextBox with height:<asp:TextBox id="tb6" rows="5" TextMode="multiline"runat="server" /><br /><br />A TextBox with width:<asp:TextBox id="tb5" columns="30" runat="server" /></form></body></html>
  • <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>
  • <html><body><form runat="server"><asp:Imagerunat="server"AlternateText="W3Schools"ImageUrl="/banners/w6.gif"/></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>
  • <script  runat="server">sub check_operator(sender As Object, e As EventArgs)    compval.Operator=CType(list.SelectedIndex,ValidationCompareOperator)   compval.Validate()end sub</script><html><body><form runat="server"><table border="0" bgcolor="#b0c4de">   <tr valign="top">     <td colspan="4"><h4>Compare two values</h4></td>   </tr>    <tr valign="top">     <td><asp:TextBox id="txt1" runat="server" /></td>     <td>     <asp:ListBox id="list" rows="2" OnSelectedIndexChanged="check_operator" runat="server">           <asp:ListItem value="Equal" selected>=</asp:ListItem>           <asp:ListItem value="NotEqual"><></asp:ListItem>     </asp:ListBox>     </td>     <td><asp:TextBox id="txt2" runat="server" /></td>     <td><asp:Button Text="Validate" runat="server" /></td>   </tr></table><br /><asp:CompareValidatorid="compval" Display="dynamic"ControlToValidate="txt1" ControlToCompare="txt2" ForeColor="red" BackColor="yellow" Type="String"EnableClientScript="false" Text="Validation Failed!" runat="server" /></form></body></html>
  • <%@ Import Namespace="System.Data.OleDb" %><script  runat="server">sub Page_Loaddim dbconn,sql,dbcomm,dbreaddbconn=New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;data source=" & server.mappath("/db/northwind.mdb"))dbconn.Open()sql="SELECT * FROM customers"dbcomm=New OleDbCommand(sql,dbconn)dbread=dbcomm.ExecuteReader()customers.DataSource=dbreadcustomers.DataBind()dbread.Close()dbconn.Close()end sub</script><html><body><form runat="server"><asp:DataListid="customers"runat="server"cellpadding="2"cellspacing="2"borderstyle="inset"backcolor="#e8e8e8"width="100%"headerstyle-font-name="Verdana"headerstyle-font-size="12pt"headerstyle-horizontalalign="center"headerstyle-font-bold="True"itemstyle-backcolor="#778899"itemstyle-forecolor="#ffffff"footerstyle-font-size="9pt"footerstyle-font-italic="True"><HeaderTemplate>Customers Table</HeaderTemplate><ItemTemplate><%#Container.DataItem("companyname")%>  in<%#Container.DataItem("address")%>, <%#Container.DataItem("city")%></ItemTemplate><FooterTemplate>Source: Northwind Database</FooterTemplate></asp:DataList></form></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>
  • Presentasi Kelompok 25 PW A+B

    1. 1. ASP .NET 2.0 and ASP .NET AJAX<br />5108100011 – Hapsoro Adi P.<br />5108100053 – Thaufan Ardi A.<br />5108100099 – Jun Riandri<br />
    2. 2. DEFINISI<br />Web application framework buatan MS<br />ASP -> Active Server Pages<br />
    3. 3. KELEBIHAN<br />Mudah digunakan<br />Lebih cepat dari PHP<br />Language support (VB.NET, C#, etc)<br />User friendly<br />Murah (free installation package)<br />
    4. 4. How Active Server Pages Work<br />Client sends request<br />Server receives request and directs it to ASP<br />ASP processes, then returns result to client<br />HTTP request types<br />Request methods<br />GET<br />Gets (retrieves) information from server<br />Retrieve HTML document or image<br />POST<br />Posts (sends) data to server<br />Send info from HTML form<br />Client-entered data<br />Info to search Internet<br />Query for a database<br />Authentication info<br />
    5. 5. How Active Server Pages Work<br />Browsers often cache Web pages<br />Cache: save on disk<br />Typically do not cache POST response<br />Next POST request may not return same result<br />Client requests ASP file<br />Parsed (top to bottom) by ActiveX component asp.dll<br />ActiveX component: server-side ActiveX control that usually does not have GUI<br />Code executed as encountered<br />@LANGUAGE statement<br />Specifies scripting language<br />If not used, VBScript assumed<br />As interpreted, HTML (plus client-side scripts) sent to client<br />Parsed each time requested<br />Web server must support ASP by providing component such as asp.dll<br />
    6. 6. ASP .NET 2.0 & AJAX<br />Server-side ActiveX Components<br />Web controls<br />Session tracking<br />Case study<br />AJAX<br />
    7. 7. Server-side ActiveX Components<br />Server-side ActiveX components<br />Typically do not have GUI<br />If scripting language for ASP not support certain feature, create ActiveX Server component<br />Visual C++, Visual Basic, Delphi, etc.<br />Usually execute faster than scripting language equivalents<br />Executed on server<br />Client does not need to support ActiveX technologies<br />
    8. 8. WEB CONTROLS<br />Text controls<br />AdRotator controls<br />Validation controls<br />
    9. 9. Text Control (1)<br /><html><body><form runat="server">A basic TextBox:<asp:TextBox id="tb1" runat="server" /><br /><br />A password TextBox:<asp:TextBox id="tb2" TextMode="password" runat="server" /><br /><br />A TextBox with text:<asp:TextBox id="tb4" Text="Hello World!" runat="server" /><br /><br />A multiline TextBox:<asp:TextBox id="tb3" TextMode="multiline" runat="server" /><br /><br />A TextBox with height:<asp:TextBox id="tb6" rows="5" TextMode="multiline"runat="server" /><br /><br />A TextBox with width:<asp:TextBox id="tb5" columns="30" runat="server" /></form></body></html> <br />
    10. 10. Text Controls (1)<br />
    11. 11. Text Controls (2)<br />
    12. 12. Text Controls (2)<br /><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><br />
    13. 13. Image Controls<br />
    14. 14. adRotator<br />
    15. 15. Validation Controls (1)<br /><script  runat="server">sub check_operator(sender As Object, e As EventArgs)    compval.Operator=CType(list.SelectedIndex,ValidationCompareOperator)   compval.Validate()end sub</script><html><body><form runat="server"><table border="0" bgcolor="#b0c4de">   <tr valign="top">     <td colspan="4"><h4>Compare two values</h4></td>   </tr><br />
    16. 16. Validation Controls (1)<br />   <tr valign="top">     <td><asp:TextBox id="txt1" runat="server" /></td>     <td>     <asp:ListBox id="list" rows="2" OnSelectedIndexChanged="check_operator" runat="server">           <asp:ListItem value="Equal" selected>=</asp:ListItem>           <asp:ListItem value="NotEqual"><></asp:ListItem>     </asp:ListBox>     </td>     <td><asp:TextBox id="txt2" runat="server" /></td>     <td><asp:Button Text="Validate" runat="server" /></td>   </tr></table><br /><asp:CompareValidatorid="compval" Display="dynamic"ControlToValidate="txt1" ControlToCompare="txt2" ForeColor="red" BackColor="yellow" Type="String"EnableClientScript="false" Text="Validation Failed!" runat="server" /></form></body></html><br />
    17. 17. Validation Controls (1)<br />
    18. 18. Session Tracking<br />Cookies<br />
    19. 19. What is a Cookie?<br />A cookie is often used to identify a user. <br />A cookie is a small file that the server embeds on the user's computer. <br />Each time the same computer requests a page with a browser, it will send the cookie too. <br />With ASP, you can both create and retrieve cookie values.<br />
    20. 20. Accessing a Database from an Active Server Page<br />ASP can communicate with databases<br />Via ADO (ActiveX Data Objects)<br />Three-tier distributed applications<br />User interface<br />Often created using HTML, Dynamic HTML or XML<br />Business logic<br />Use Web servers<br />Database access<br />All three tiers may reside on separate computers connected to a network<br />
    21. 21. With database<br />
    22. 22. 1 <% @LANGUAGE = VBScript %><br /> 2 <%Option Explicit%><br /> 3 <br /> 4 <%' Fig. 26.16 : login.asp%><br /> 5 <br /> 6 <%<br /> 7 ' Set up the variables for this page<br /> 8 Dim dbConn, dbQuery, loginRS, loginFound<br /> 9 <br /> 10 ' Check to see if there is an existing connection to<br /> 11 ' the Database. If not, create one<br /> 12 IfIsObject( Session( "mothergoose_dbConn" ) ) Then<br /> 13 Set dbConn = Session( "mothergoose_dbConn" )<br /> 14 Else<br /> 15 Set dbConn = Server.CreateObject( "ADODB.Connection" )<br /> 16 Call dbConn.Open( "mothergoose", "", "" )<br /> 17 Set Session( "mothergoose_dbConn" ) = dbConn<br /> 18 End If<br /> 19 <br /> 20 ' Create the SQL query<br /> 21 dbQuery = "SELECT * FROM users"<br /> 22 <br /> 23 ' Create the recordset<br /> 24 Set loginRS = Server.CreateObject( "ADODB.Recordset" )<br /> 25 Call loginRS.Open( dbQuery, dbConn )<br /> 26 <br /> 27 On Error Resume Next' If an error occurs, ignore it<br /> 28 <br /> 29 ' Move to the first record in the recordset<br /> 30 Call loginRS.MoveFirst()<br /> 31 %><br /> 32 <br /><ul><li>1.1 Test if session variable mothergoose_dbConn is storing an object
    23. 23. 1.2 If not, create an ADODB.Connection object to open a connection
    24. 24. 1.3 Create SQL query
    25. 25. 1.4 Create recordset</li></li></ul><li>33<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"><br />34<HTML><br />35<HEAD><TITLE>Login Page</TITLE></HEAD><br />36<br />37<BODY><br />38<!-- include header goes here--> <br />39<!-- #include virtual = "/includes/mgtheader.inc" --><br />40<br />41<%<br />42 ' If this is a return after a failed attempt, print an error<br />43If Session( "loginFailure" ) = True Then%><br />44<FONT SIZE =4COLOR ="red"> Login attempt failed, <br />45please try again <P></FONT><br />46<%End If%><br />47<br />48<%' Begin the form%><br />49<FONT FACE ="arial"SIZE =2><br />50Please select your name and enter <br />51your password to login:<BR><br />52</FONT><br />53<FORM NAME =sublogformACTION ="submitlogin.asp" METHOD =POST><br />54<br />55<%' Format the form using a table%><br />56<TABLE BORDER = 0><br />57<TR><br />58<TD><FONT FACE ="arial"SIZE =2>Name:</FONT></TD><br />59<TD><SELECT NAME ="LOGINID"><br />60<OPTION VALUE ="000">Select your name<br />61<%<br />62 ' Pull user names from the query to populate the dropdown<br />63WhileNot loginRS.EOF<br />64<br /><ul><li>1.5 Test if session variable loginFailure is True
    26. 26. 1.6 Create dropdown menu from recordset</li></li></ul><li>65 ' If there is a session loginid, reuse it<br />66If Session( "loginid" ) = loginRS( "loginid" ) Then<br />67 loginFound = "selected "<br />68End If<br />69<br />70 ' If a login cookie was found, reuse it<br />71IfRequest.Cookies( "loginid" ) = loginRS( "loginid" ) Then<br />72 loginfound = "selected "<br />73End If<br />74<br />75 ' Create each dropdown entry %><br />76<OPTION<% =loginFound %><br />77VALUE = "<%=loginRS( "loginid" )%>"><br />78<% =loginRS( "loginid" ) %><br />79<% loginfound = " " %><br />80<%<br />81Call loginRS.MoveNext()<br />82Wend<br />83%><br />84</SELECT><br />85</TD><br />86</TR><br />87<br />88<TR><br />89<TD><FONT FACE ="arial"SIZE ="2">Password:</FONT></TD><br />90<TD><INPUT TYPE ="password" NAME = "SUBMIT_LOGIN"></TD><br />91</TR><br />92<TR><br />93<TD>&nbsp;</TD><br />94<TD ALIGN ="LEFT"><INPUT TYPE = "submit" VALUE ="Log Me In" <br />95ID ="login1"NAME ="login1"></TD><br />96</TR><br /><ul><li>1.7 Test for session loginid and loginid cookie (written by submitlogin.asp)</li></li></ul><li> 97 </TABLE><br /> 98 </FORM><br /> 99 </FONT><br /> 100 <br /> 101 <!-- #include virtual = "/includes/mgtfooter.inc" --><br /> 102 <br /> 103 </BODY><br /> 104 <br /> 105 </HTML><br />
    27. 27. AJAX<br />AJAX = Asynchronous JavaScript and XML.<br />AJAX is based on JavaScript and HTTP requests.<br />AJAX is not a new programming language, but a new way to use existing standards.<br />AJAX is the art of trading data with a web server, and changing parts of a web page, without reloading the whole page.<br />
    28. 28. Sejarah AJAX<br />Padaawalnya ASP.NET AJAX diberinama Atlas.<br />Dirilispadatahun 2005 dalambentuk CTPs (Community Tkenis Previews)<br />ASP.NET AJAX 1.0 RTM dirilis 23 januari 2007 sebagaitembahan ASP.NET 2.0<br />
    29. 29. Browser support<br />IE (>= 6.0)<br />Mozilla Firefox (>= 1.5)<br />Opera (>= 9.0)<br />Apple Safari (>= 2.0)<br />Google Chrome<br />
    30. 30. Arsitektur ASP.NET AJAX<br />ASP.NET AJAX merupakan framework ygterdiridaripusaka script client dankomponen server ygterintegrasi.<br />Komponen server ASP.NET AJAX terdiridarikontrol – kontrol web server ASP.NET dan komponen2 untungmengatur UI danaluraplikasi, validasi, control server, dansebagainya.<br />
    31. 31. Control server<br />Contoh control server ASP.NET AJAX ygseringdigunakan :<br />- ScriptManager<br />- UpdatePanel<br />- UpdateProgress<br />- Timer<br />
    32. 32. AJAX<br />

    ×