配置ajax.net:
<configuration>
<system.web>
<httpHandlers>
<add verb="POST,GET" path="
type="Ajax.PageHandlerFactory,
</httpHandlers>
...
<system.web>
</configuration>
//C#
public class Index : System.Web.UI.Page{
private void Page_Load(object sender, EventArgs e){
Ajax.Utility.RegisterTypeForAjax(typeof(Index));
//...
}
//...
}
用ajax.net做了个(C#写的),几点体会,或是过程:
1.
[AjaxMethod()]
public void MethodYouWant()
{
//do as before
return;
}
2.
write client-side
//call the server
function getServer()
{
/*
the first parameter is the parameter needed in serverMethod
the second parameter is the callback meathod name
*/
ClassNameInServer.Method(list of parameter,callback_getServer);
}
/*call back method , that do with form,document,window,or others*/
/* response is only a flay ,you can also use res,ect
but , you must know the value contains parts:request,
error,value
*/
function callback_getServer(response)
{
//only a examply
document.write(response.value.toString());
}
ok now ,you can try .
Maybe I forget to say that you must configu the ajax.net before you use .these information you can find in some websites.
When I finished , I really thought ajax is coming to me now !
Good luck !