6.在page页面的Page_Load事件中加上
private void Page_Load
(object sender, System.EventArgs e)
{
// 在此处放置用户代码以初始化页面
Ajax.Utility.RegisterTypeForAjax
(typeof(AjaxSample.DemoMethods));
}
注意:typeof(AjaxSample.DemoMethods)中,AjaxSample是命名空间,DemoMethods是要包含要调用方法的类,即上面第3步.新建类DemoMethods
7.修改Global.asax的Application_Start事件,设置Ajax的HandlerPath :
protected void Application_Start
(Object sender, EventArgs e)
{
Ajax.Utility.HandlerPath = "ajax";
}
运行看看效果。是不是没有刷新就在服务器端取到客户端的MAC地址?
需要注意的是:该版本的.net Ajax需要手工在中Global.asax加上Ajax.Utility.HandlerPath = "ajax"; 配置文件web.config必须加上HttpHandler的配置信息!
该开发包的新版本还没有来得及体验,估计新版本中会方便一些,可能会去掉手动的设置Global.asax的Application_Start事件中加上Ajax.Utility.HandlerPath = "ajax";以及其他麻烦的设置!
|
||
相关热词搜索: |
||
收藏到网摘: | ||
|