TAILIEUCHUNG - Beginning Ajax with ASP.NET- P12

Beginning Ajax with P12: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. | What Is Built into ASP. NET Get our callback event reference string js this arg OnServerCallComplete ctx true Create a simplified wrapper method StringBuilder newFunction new StringBuilder function StartAsyncCall arg ctx js Now register it NewAsyncMethod true region ICallbackEventHandler Members public string GetCallbackResult return Server method completed at public void RaiseCallbackEvent string eventArgument 2000 endregion So now you have a fully functional albeit very simple implementation of Asynchronous Client Script Callbacks. The server-side methods in this example are extremely simple and would not normally have any problems or generate any exceptions but in a normal application where complexity is much higher this is a very real consideration. Luckily the asynchronous client script framework provides a mechanism for handling this. Handling Errors in the Asynchronous Process When an error occurs on the server this usually means an exception has been thrown. Obviously some way of identifying when an exception has occurred and dealing with this on the client browser is required. In the same way that you defined a JavaScript method that is called on completion of the asynchronous process you can define a JavaScript method that is called when an exception is raised on the server during your asynchronous callback. This is specified as an additional parameter in the call to the GetCallbackEventReference method which is shown in the following example string js this arg OnServerCallComplete ctx OnServerCallError true The parameter that contains OnServerCallError identifies the name of the JavaScript method that is called when an exception occurs on the server. The .

TỪ KHÓA LIÊN QUAN
TAILIEUCHUNG - Chia sẻ tài liệu không giới hạn
Địa chỉ : 444 Hoang Hoa Tham, Hanoi, Viet Nam
Website : tailieuchung.com
Email : tailieuchung20@gmail.com
Tailieuchung.com là thư viện tài liệu trực tuyến, nơi chia sẽ trao đổi hàng triệu tài liệu như luận văn đồ án, sách, giáo trình, đề thi.
Chúng tôi không chịu trách nhiệm liên quan đến các vấn đề bản quyền nội dung tài liệu được thành viên tự nguyện đăng tải lên, nếu phát hiện thấy tài liệu xấu hoặc tài liệu có bản quyền xin hãy email cho chúng tôi.
Đã 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.