Beginning Ajax with ASP.NET- P19

Beginning Ajax with P19:Thank you for purchasing Beginning Ajax with . 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 protected void Page_Load object sender EventArgs e this 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 framework opens up options that are not found in most server-side frameworks. One benefit of 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 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 and MagicAjax with their changed-HTML-only architecture can .

Không thể tạo bản xem trước, hãy bấm tải xuống
TỪ KHÓA LIÊN QUAN
TÀI LIỆU MỚI ĐĂNG
32    96    2    02-07-2024
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.