I used ajax to build a GIS project two days ago. I wanted to use ajaxpro, but I couldn't find the source code. I wrote a similar project based on Huludao.
(Including simple frameworks and instances)
/Files/sukyboor/ajax.rar
Usage:
1. Add
<! -- Ajax -->
<Httphandlers>
<Add verb = "post, get" Path = "ajax/*. ashx" type = "Ajax. pagehandlerfactory, Ajax"/>
</Httphandlers>
2 ajaxtest. BR, ajaxtest indicates the business processing class
Add the Ajax. ajaxmethod () attribute to the method called on the client for this class
1 using system;
2 Using ajax;
3
4 namespace ajaxtest
5 {
6/** // <summary>
7 // a Summary of the BR.
8 /// </Summary>
9 Public Class BR
10 {
11
12 // obtain the table tablename data, which is returned as an XML string
13 [Ajax. ajaxmethod ()]
14 public static string showmsg ()
15 {
16 return "System Call return! ";
17}
18
19 // obtain the table tablename data, which is returned as an XML string
20 [Ajax. ajaxmethod ()]
21 public static string getxmldatarows (string T, string a, string B)
22 {
23 return string. Format ("<? XML version =/"1.0/" encoding =/"UTF-8/"?> <Doc> <t> {0} </T> </DOC> ", t );
24}
25}
26}
27
3. Add
<SCRIPT src = "ajax/common. ashx" type = "text/JavaScript"> </SCRIPT>
<SCRIPT src = "ajax/ajaxscript. ashx? Type = ajaxtest. BR, ajaxtest "type =" text/JavaScript "> </SCRIPT>
Note that the type of the ajaxscript. ashx file is the class to be called. If the type is set, all methods with Ajax. ajaxmethod () attributes in the class can be accessed on the client. <HTML>
<Head>
<SCRIPT src = "ajax/common. ashx" type = "text/JavaScript"> </SCRIPT>
<SCRIPT src = "ajax/ajaxscript. ashx? Type = ajaxtest. BR, ajaxtest "type =" text/JavaScript "> </SCRIPT>
<SCRIPT>
// The last parameter is the callback method. Triggered after interaction with the background
BR. getxmldatarows ('xt _ name_t ', 'A', 'test data', showmsg );
BR. getxmldatarows ('xt _ name_t ', 'A', 'test data', showmsg );
// Return value of Method s
Function showmsg (s ){
VaR Doc = new ajaxdom (s );
Document. Write (Doc. selectsinglenode ("DOC/t"). Text );
}
// If there is no callback method, the system will wait for the data to be read...
Document. Write (Br. showmsg ());
Document. Write (Br. showmsg ());
</SCRIPT>
</Head>
<Body>
</Body>
</Html>
This is easy. When I have time, I will port the data lifetime and some client components, as it is.
Http://sukyboor.cnblogs.com/archive/2006/07/21/456616.html