ASPNET Tutorials
ASPNETAddressing the Long Process of ASP.Net
The latest version of ASP.Net is regarded as one of the best framework for Ajax today. Its ability to integrated different functions is almost second to none giving developers more functions to work with for better customization. There are also independent applications that could be integrated to the ASP.Net giving developers even more functions. The options are virtually endless when you use ASP.Net when you build an Ajax based website with this framework.
However, the complexity of Ajax based applications with ASP.Net has its downsides. As we grow accustomed to complicated online applications, developers are forced to write very long codes which means complicated functions of ASP.Net will work but it will take a long time before it is actually implemented.
When the function is coded too long, the possibility of run-time error increases since the client side will have to wait only for specific amount of time for a response from the server.
After the specific amount of time, the client will show a run-time error if there are no response from the server. This situation is becoming common today since more and more applications and websites have very complicated functions to keep up with the demands of the user.
To address these problems, two functions have to be used effectively in ASP.Net: IAsyncResult and ICallBackEventHandler.
IAsyncResult is a very useful function when dealing with the long process of ASP.Net since it enables additional functions to be executed while the longer function is being executed from the server.
In keeping up with the asynchronous ability of the website, this function enables the second or even third function while the longer process is executed. Each additional and shorter function has their delegations.
The delegations are important in ASP.Net since it divides the functions and executing them altogether as long as the server can hold it. These delegates have parameters and variables that it could execute faster and better.
When the smaller functions are finished with the help of delegates, the IAsyncResult will go back to the original function and check if the process is done. The IAsyncResult uses the CallBackMethod so that it could get the status of the process.
Going further, the CallBackMethod is used at the end of the long process since it will inform the client if the function is complete and is ready for execution. CallBackMethod uses classes to return objects and additional information about the function such as when the streaming of the information will begin or when will the information streaming ends.
The ICallBackEventHandler on the other hand is used to check the status of function. The ICallBackEventHandler however, is not just used for this event. This function can also be used to check other functions.
For example, the smaller functions handled by delegates. However, the ICallBackEventHandler is not really used in these functions since they are too small and adding this function is just unnecessary.
By effectively using ICallBackEventHandler and IAsyncResult with Delegates, developers can address the problem of longer processes and build a well functioning Ajax based website.
AjaxWith.com Offers
Sponsored Links
