详见ajax.net: http://ajax.schwarz-interactive.de/csharpsample/default.aspx
<system.web>
<httpHandlers>
<!-- Register the ajax handler -->
<add verb="POST,GET" path="ajax/*.ashx" type="Ajax.PageHandlerFactory,Ajax" />
<add verb="*" path="*.js.aspx" type="ExtWebTest.CompressionHttpHandler,ExtWebTest"/>
参照设定 追加Ajax.dll
WebForm7.sendstr('Y',showdatafun);
function showdatafun(res)
{
var myData=eval(res);
}
//==form.load(){}
Ajax.Utility.RegisterTypeForAjax(typeof(ExtWebTest.WebForm2));
[Ajax.AjaxMethod()]
public string sendstr(string aa)
{
return aa+aa;
}