AJAX.net 能够通过JavaScript 调用执行服务器端方法,而不需要刷新浏览器
1.添加Ajax.dll引用.
2.配置WebConfig
<configuration>
<system.web>
<httpHandlers>
<!-- Register the ajax handler -->
<add verb="POST,GET" path="ajax/*.ashx"
type="Ajax.PageHandlerFactory, Ajax" />
</httpHandlers>
</system.web>
</configuration>
3.要使用的函数必须标有 Ajax.AjaxMethodAttribute。其次,在页加载事件期间,必须通过调用 Ajax.Utility.RegisterTypeForAjax 来注册包含这些函数的类
4.编写客户端Javascript函数
<script language="javascript">
Class.AjaxMethod([参数....],AjaxMethod_CallBack);
function AjaxMethod_CallBack(response)
{
................................
}
</script>