<form id="form1" runat="server">
<asp:ScriptManager ID="ScriptManager1" EnablePageMethods="true" runat="server">
</asp:ScriptManager>
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>....//页面内容
//jvavascript函数
function DepartmentChange() {
//setTimeout("searchDiv.style.display =''", 500);
var cDepartment = document.getElementById("<%=ddlDepartmentD.ClientID %>");
PageMethods.GetSalseByDepartment(cDepartment.value, SetUser);
//setTimeout("document.getElementById('bgDiv').style.display =''", 500);
}
//服务端方法
/// <summary>
/// 得到指定部门的SalseID的字符串
/// </summary>
/// <param name="strID">部门ID</param>
[System.Web.Services.WebMethod]
public static string GetSalseByDepartment(string strID)
{...}
asp.net中ajax使用(客户端调用服务端方法)
最新推荐文章于 2017-03-16 13:05:00 发布