Ajax|ajax Frame Author: Chen Source: Pole Development Responsible Editor: Ark [2006-03-16 15:01] This article implements only one of the most basic AJAX frameworks. Although Ajax is not a new technology, it is not an article that explains the white This article is just a basic AJAX framework, although AJAX is not a new technology, but as a framework is not an article can explain the white. The purpose of this article: to help beginners learn better and use the AJAX framework.
I always believe that only if you really understand a technology and understand the technology itself can you use it better and more flexibly. A programmer's understanding of technology cannot be confined to the application of technology.
Environment: Window Xp SP2 +. Net framwwork 2.0.50727.
asp.net 2.0 self-brought client callback
ASP.net 2.0 has been released. 2.0 has many new features, and the client callback is one of them. The client callback allows us to invoke the server-side method without a postback, which is consistent with the functionality provided by Ajax, but not as flexible as Ajax, where Ajax can customize the calling method, with 2.0 of its own callback capabilities.
The System.Web.UI.IcallbackEventHandler interface must be implemented to use the client callback feature.
This interface contains two methods:
Fixed call this method when client callback public void RaiseCallbackEvent (String eventargument) This method is called after the raisecallbackevent has been executed. The return value of this method is sent back to the client public string GetCallbackResult () |
Example one:
. CS: String cbreference = Page.ClientScript.GetCallbackEventReference (This, "Arg", "receiveserverdata", "context"); String Callbackscript; Callbackscript = "function CallServer (ARG, context)" + "{" + Cbreference + "};"; Page.ClientScript.RegisterClientScriptBlock (this. GetType (), "CallServer", Callbackscript, True); Javascript:
|
See MSDN for more information.
- Ajax: A new way to build Web apps
- Discussion on the error handling mechanism of AJAX (2)
- Discussion on the error handling mechanism of AJAX (1)
- First experience. NET Ajax Brushless New technology
- A brief analysis of Ajax development Technology in Rails system (4)