Đang chuẩn bị liên kết để tải về tài liệu:
Beginning Ajax with ASP.NET- P19

Đang chuẩn bị nút TẢI XUỐNG, xin hãy chờ

Beginning Ajax with ASP.NET- P19:Thank you for purchasing Beginning Ajax with ASP.NET. We know that you have a lot of options when selecting a programming book and are glad that you have chosen ours. We’re sure you will be pleased with the relevant content and high quality you have come to expect from the Wrox Press line of books. | Chapter 9 This example uses the Anthem_InvokePageMethod function to call a method on the server that will throw an unhandled exception. When the callback function runs the response object is evaluated to see if an error exists. If the error is present then the error message is displayed to the user. Next update the markup by adding the following code between the div tags input type button ID btnTest onclick ShowError value Throw Unhandled Exception on Server Since you are calling the server-side code directly you do not need to use an Anthem control. Finally update the ServerException class with the following code-behind public partial class ServerException System.Web.UI.Page protected void Page_Load object sender EventArgs e Anthem.Manager.Register this Anthem.Method public string ShowError throw new Exception Something went very wrong. You can now test the behavior by launching the page in the browser. What You Have Learned The Anthem.NET framework opens up options that are not found in most server-side frameworks. One benefit of Anthem.NET is a noninvasive configuration option for integration into your application. You can also choose between methods that simply change the HTML on your pages or work directly with returned data to the client. Throw in support for custom controls and Anthem.NET may be the best of both worlds. Summary You have had an opportunity to review three client-side Ajax frameworks and work with three serverside Ajax frameworks that approach problems in development in different ways. On the client side Sarissa HTMLHttpRequest and MochiKit provide a lightweight way of abstracting the details away of making XMLHttpRequest calls through the browser. Each client-side framework includes much more than just Ajax abstractions so be sure to examine each library for the best fit with your application before choosing one. 246 Other Ajax Frameworks for .NET On the server side ComfortASP.NET and MagicAjax with their changed-HTML-only architecture can .