Ini adalah materi untuk mata kuliah Topik Khusus Internet setelah UTS. Saya buat seperti run-down acara agar mudah jika dimanfaatkan juga untuk mengajar. Dimulai dari apa itu ASP.NET, cara instalasi, dan environmentnya. Kemudian sekilas belajar ASP biasa, apa bedanya dengan ASP.NET. Dan diakhiri dengan pengenalan HTML control dan Web Control.
ASP.NET is a programming framework built on the common language runtime that can be used on a server to build powerful Web applications. ASP.NET offers several important advantages over previous Web development models: - Enhanced Performance. ASP.NET is compiled common language runtime code running on the server. Unlike its interpreted predecessors, ASP.NET can take advantage of early binding, just-in-time compilation, native optimization, and caching services right out of the box. This amounts to dramatically better performance before you ever write a line of code.
- World-Class Tool Support. The ASP.NET framework is complemented by a rich toolbox and designer in the Visual Studio integrated development environment. WYSIWYG editing, drag-and-drop server controls, and automatic deployment are just a few of the features this powerful tool provides.
- Power and Flexibility. Because ASP.NET is based on the common language runtime, the power and flexibility of that entire platform is available to Web application developers. The .NET Framework class library, Messaging, and Data Access solutions are all seamlessly accessible from the Web. ASP.NET is also language-independent, so you can choose the language that best applies to your application or partition your application across many languages. Further, common language runtime interoperability guarantees that your existing investment in COM-based development is preserved when migrating to ASP.NET.
- Simplicity. ASP.NET makes it easy to perform common tasks, from simple form submission and client authentication to deployment and site configuration. For example, the ASP.NET page framework allows you to build user interfaces that cleanly separate application logic from presentation code and to handle events in a simple, Visual Basic - like forms processing model. Additionally, the common language runtime simplifies development, with managed code services such as automatic reference counting and garbage collection.
- Manageability. ASP.NET employs a text-based, hierarchical configuration system, which simplifies applying settings to your server environment and Web applications. Because configuration information is stored as plain text, new settings may be applied without the aid of local administration tools. This "zero local administration" philosophy extends to deploying ASP.NET Framework applications as well. An ASP.NET Framework application is deployed to a server simply by copying the necessary files to the server. No server restart is required, even to deploy or replace running compiled code.
- Scalability and Availability. ASP.NET has been designed with scalability in mind, with features specifically tailored to improve performance in clustered and multiprocessor environments. Further, processes are closely monitored and managed by the ASP.NET runtime, so that if one misbehaves (leaks, deadlocks), a new process can be created in its place, which helps keep your application constantly available to handle requests.
- Customizability and Extensibility. ASP.NET delivers a well-factored architecture that allows developers to "plug-in" their code at the appropriate level. In fact, it is possible to extend or replace any subcomponent of the ASP.NET runtime with your own custom-written component. Implementing custom authentication or state services has never been easier.
- Security. With built in Windows authentication and per-application configuration, you can be assured that your applications are secure.
ASP.NET Server Controls Recommendations This topic will help you decide when each type of control is appropriate. You can mix control types on the same page. For example, your Web Forms page might include a form made up of Web server controls plus an HTML server control converted from an HTML <SPAN> element. The following table summarizes when to use Web server controls and when to use HTML server controls. | Type of control | Use it when | | Web server control | - You prefer a Visual Basic-like programming model.
- You are writing a Web Forms page that might be used by both HTML 3.2 and HTML 4.0 browsers.
- You need specific functionality such as a calendar or ad rotator that is available only as a Web server control.
- You are creating applications with nested controls and want to be able to catch events at the container level.
| | HTML server control | - You prefer an HTML-like object model.
- You are working with existing HTML pages and want to quickly add Web Forms functionality. Because HTML server controls map exactly to HTML elements, they can be supported by any HTML design environment.
- The control will also interact with client script.
| Note You can also create output for mobile devices. To do so, you use the same ASP.NET page framework, but you create Mobile Web Forms instead of Web Forms pages and use controls specifically designed for mobile devices. For details, see Creating ASP.NET Mobile Web Applications. More on Choosing Controls As a general rule, Web server controls are more capable and have a richer object model than HTML server controls. If you are writing your Web Forms page so that all processing occurs on the server, Web server controls are a good choice. Web Server Controls Web server controls are designed to provide a quick, easy way to add functionality — such as displaying data or picking dates — to a Web page. They are also designed for applications that work the same no matter what type of browser the user has. The advantages of Web server controls over HTML server controls are: - Web server controls feature a typed object model for cleaner programming and better error checking.
- They automatically generate correct HTML for both downlevel (HTML 3.2) and uplevel (HTML 4.0) browsers. For details, see ASP.NET Server Controls and Browser Capabilities.
- They can be used to build more complex server controls (such as Calendar and DataGrid).
Web server controls have the disadvantage that you have less direct control over how a server control is rendered on the page sent to the browser. For example, you cannot add HTML attributes to the controls at design time. Instead, the HTML element and its attributes are created automatically based on how you program the control. HTML Server Controls HTML server controls are useful for situations in which you will be programming a control both on the server and on the client, because the control will be identical in both run-time environments. This makes it easier to write client script for the control. When a Web Forms page is processed on the server, an instance of each HTML server control is created using the information from the underlying HTML element. Attributes recognized by the control class become properties. Unknown attributes are ignored and passed through, so that they appear in the browser as they were created in the page. (The unknown attributes are accessible to server code via the Attributes collection, but they are not made into control properties.) Using HTML server controls is also an easy way to convert an existing HTML or ASP page to a Web Forms page. By converting individual HTML elements on the page to HTML server controls, you can quickly add Web Forms functionality to the page without affecting the rest of the page. HTML server controls have the following disadvantages: - All values are strings, so there is no type safety.
- Support for rich browsers is available, but you must program it yourself using extended styles. There is no automatic detection of a browser's capabilities for styles.
Contoh kode ASP Contoh ini ditulis di file aspx. <% dim i as string i="hello world" response.write(i & "<br>") dim j as long for j=1 to 10 if j mod 2 = 0 then response.write("<font color=red>") else response.write("<font color=blue>") end if response.write("nomor " & j & "</font><br>") next %> Contoh kode ASP.NET Contoh ini ditulis di file aspx.vb pada onclick dari button. Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click Dim nilai1 As Double Dim nilai2 As Double Dim hasil As Double nilai1 = TextBox2.Text nilai2 = TextBox3.Text Select Case DropDownList1.SelectedValue Case "+" hasil = nilai1 + nilai2 Case "-" hasil = nilai1 - nilai2 Case "x" hasil = nilai1 * nilai2 Case "/" hasil = nilai1 / nilai2 End Select TextBox4.Text = hasil End Sub
|
Kuliah TKI - Blog da...
mm Apparently, 21,000 boots imported by
Clas-class php yang ...
mm Apparently, 21,000 boots imported by
Kuliah TK Internet :...
mm Apparently, 21,000 boots imported by
The Power of GIS - U...
mm Apparently, 21,000 boots imported by
Kuliah TK Internet :...
mm Apparently, 21,000 boots imported by
JPGraph - membuat gr...
timberland - mm Apparently, 21,000 bo...
Kuliah TKI : Ajax - ...
mm Apparently, 21,000 boots imported by
Banner spesial untuk...
mm Apparently, 21,000 boots imported by