var prm = Sys.WebForms.PageRequestManager.getInstance();
            alert(prm.get_isInAsyncPostBack()); //判断是否为异步提交

一.Ajax类
ajax学习笔记(1)
<form id="form1" runat="server">
ajax学习笔记(1)        
<asp:ScriptManager ID="ScriptManager1" runat="server">
ajax学习笔记(1)        
</asp:ScriptManager>
ajax学习笔记(1)    
ajax学习笔记(1)    
<script language="javascript" type="text/javascript">
ajax学习笔记(1)        Type.registerNamespace(
"AspNetAjaxOverView"); //注册命名空间
ajax学习笔记(1)
        //写一个类,=号后为构造方法
ajax学习笔记(1)
        AspNetAjaxOverView.Person = function(firstName, lastName)
把这个类注册到命名空间
AspNetAjaxOverView.Person.registerClass("AspNetAjaxOverView.Person");

ajax学习笔记(1)
    //定义子类    
ajax学习笔记(1)
        AspNetAjaxOverView.Employee = function(firstName, lastName, title)
继承父类的构造方法
AspNetAjaxOverView.Employee.initializeBase(this, [firstName, lastName]);

ajax学习笔记(1)
            
ajax学习笔记(1)            
this._title = title;
ajax学习笔记(1)        }

ajax学习笔记(1)        AspNetAjaxOverView.Employee.prototype 
= 
注册时第二个参数表明为继承父类
    AspNetAjaxOverView.Employee.registerClass("AspNetAjaxOverView.Employee", AspNetAjaxOverView.Person);

ajax学习笔记(1)
    </script>
二.异步通讯类
1.服务器端定义一个C#类
  public class Employee
 {
  private string _FirstName;
  private string _LastName;
  private string _Title;

  public Employee() { }
  public Employee(string firstName, string lastName, string title)
 
public string FirstName
  public string LastName
  public string Title
 }
2.服务器端接收请求的GetEmployee.ashx

}

3.客户端调用这个类

>

三.客户端调用Webservice
1.服务器端Webservice
ajax学习笔记(1)namespace AspNetAjaxOverview
}
2.客户端调用
ajax学习笔记(1)<asp:ScriptManager ID="ScriptManager1" runat="server">
ajax学习笔记(1)    
<Services>
ajax学习笔记(1)    
<!--为ScriptManager指定WebService服务器端程序,会自动生成客户端代理-->
ajax学习笔记(1)        
<asp:ServiceReference Path="EmployeeService.asmx" />
ajax学习笔记(1)    
</Services>
ajax学习笔记(1)
</asp:ScriptManager>
ajax学习笔记(1)
ajax学习笔记(1)
<script language="javascript" type="text/javascript">
ajax学习笔记(1)    
function showEmployee(firstName, lastName, title)
>

相关文章:

  • 2021-09-27
  • 2021-08-06
  • 2021-08-12
  • 2022-12-23
  • 2021-11-20
  • 2021-11-23
  • 2021-06-28
  • 2022-01-01
猜你喜欢
  • 2021-10-01
  • 2021-08-07
  • 2022-01-11
  • 2021-06-12
  • 2021-10-21
  • 2022-12-23
相关资源
相似解决方案